Jump to content

Not deleting data..


SoberDude

Recommended Posts

I have an AJAX script which appends the following to a span (well, it's similar):

 

<select id='select_thing' onchange='functionhere();'>
<option value='1' selected>1</option>
<option value='2'>2</option>
</select>

 

Whenever functionhere() is called, it repeats it (appends the above into that span again).

 

If you select two, it will go back to 1, which it's supposed to do (since, when the AJAX is called, it just puts the above code into the innerHTML).

 

However, if I say:

 

alert(select_thing.value);

 

after changing the value to 2, it always says 2, even though the selected value is 1.

 

So, basically, it seems to be caching the selected option or something.

 

Any fix?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/161317-not-deleting-data/
Share on other sites

I haven't a clue what you are talking about.

 

As for this...

However, if I say:

 

alert(select_thing.value);

 

after changing the value to 2, it always says 2, even though the selected value is 1.

What else would you expect the value of the field to be after changing the value to 2?

 

I think you need to provide more info on what the function is doing when it is called.

Link to comment
https://forums.phpfreaks.com/topic/161317-not-deleting-data/#findComment-851377
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.