Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Old data submitted on a submit event after a change event


Message #1 by "sara" <fillet70@h...> on Mon, 9 Dec 2002 15:41:14
Problems with old data being submitted on a submit event after a change 
event.

I have a field called login, client list box and a submit button. When the 
login is changed, the change event is triggered which retrieves the 
clients corresponding to the login. When the submit button is clicked, 
some information is displayed in a table corresponding to the login and 
the selected client. But i have a problem which is explained below.
Ex: login = x, client = a
When i click the submit button, information is displayed for login x and 
client a. When i change the login to "y" and click the submit button(two 
events should be queued up - change event, click event), the change event 
retrieves the new clients for login "y"(the first client is by default the 
selected value - say client = b), but the click event on the submit button 
does not use the new clients. Instead it submits the page with client=a 
and i get the information for login y and client a which is wrong as the 
user with login y may not work for client a. Looks like the page is not 
being refreshed with the data retrieved by the change event and hence the 
submit event is submitting the old data.
Is there a way around this ?

  Return to Index