Jump to content

Ajax Dynamic List In For Loop


Muiter

Recommended Posts

Or is there any other way to use an ajax like dropdown menu in an list.This is my situation. I need (in an loop) a pulldown menu and when there is a item selected I want the corresponding value to be entered in an textfield so it can be changed if needed by the user.

Link to comment
Share on other sites

If you've got the same problem as in another script, wouldn't you use the same solution?If you want something to happen when you choose an item in a select element, there are a ton of examples of that online. You need to assign an onchange event handler to the select element which runs a function to get the value that was selected and set it as the value of a text input. I'm not sure where ajax comes into play, all you need is a form with a select element, text input, and submit button, and an event handler on the select element to update the text input when the value in the select changes.There's an example of the onchange event here:http://www.w3schools.com/jsref/event_onchange.asp

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...