Replace text with combo, save change to combo, then reflect

Hello, I have a page which shows a list of rooms where travelers can be placed… Each room has 4 slots to accept travelers, and the travelers are already in the database in a related table.



Each of these slots has an “edit” link, and then displays the travelers’ name, if there is one. Upon selecting the edit link, I want to replace the static name with a combo, and then as soon as a change is made, I’d make a get request like this:



ChangeTraveler.asp?TravelerID=1704&OldID=123&NewID=321



The data relations go sort of like this:



Groups --> Rooms --> Travelers <-- TourTravelers



After submitting the change, we’d just need to reflect back some status to the user.



I’ve made some progress on this so far, but any tips you may have would be greatly appreciated!



–Jon


Hello,


combo has onChange. It is called each time the combo value changed.


combo.attachEvent(“onChange”,function(){


var value = combo.getActualValue();


/* your code here */


})


You can use this event to execute the necessary action: for example you can reload other combos when the value is changed or send Ajax request to pass selected value to the server.

Okay, that’s cool, I was wondering how to get the value out of it, but how do I get the postback to the original page?


You can use Ajax to pass selected value to server-side script.