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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.