Forum Moderators: open

Message Too Old, No Replies

Adding content to a form (using AJAX) resets the other form controls.

         

swinstead

10:35 am on Oct 21, 2009 (gmt 0)

10+ Year Member



Hi,

I have a drop down list to select a product, on a form.

There's a button for "Add another product" which inserts another drop down box into the form (with an incremented id, of course).

The problem is that if I select an item from a drop down box and then add another one, the previous box goes back to the default selection.

Is there an easy way to get around this?

PC_Advocate

9:23 am on Oct 22, 2009 (gmt 0)

10+ Year Member



This sounds like it has the same id and therefore updating the first when you update the second. Try adding a counter to the ids.

[edited by: Fotiman at 12:48 pm (utc) on Oct. 22, 2009]
[edit reason] No URLs please. See TOS [webmasterworld.com] [/edit]