php - Make value=null when page first loads

949

Is it possible to remove a value whilst the page is loading?

I'm using OSClass, and on one of the pages it's by default adding a value for region (cambridshire):

I need to clear this value since it's causing problems, everytime I type something else in, by default, it registers it as Cambridgeshire...

If I look at code for it:

It's being generated by a function (can see my JQuery attempt to clear it which hasn't worked).

Then if I search the function is splits up in many different parts, so I don't know where to go from there.

Basically, is there a way to remove the value when page loads and save the new value when the user submits?

JSFiddle - Note it won't display anything due to the way code is generated

917

Answer

Solution:

Have you tried removing<?php ItemForm::region_text(); ?> on it's own? Or passing an empty string<?php ItemForm::region_text(''); ?>

I'm not familiar with OSClass though I'm afraid.

758

Answer

Solution:

Paste this code below thejQuery initialization:

$(document).ready(function(){
  $("#region").val('');
})

People are also looking for solutions to the problem: php - Export Array of SimpleXMLElement objects to MySQL Database

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.