PDA

View Full Version : AJAX/ Javascript Issue



WBJ
10 Feb 2010, 11:29 AM
I'm sure this is more an issue with my code so any ideas are greatly appreciated.

The Set-up:

I have a div in which a user can edit the text. There is an attached onBlur call on that div that sends the text out to a script, updates a database, compares the user changed text to the original text in the database and marks the user submitted changes in a blue color and sends the new marked text back to the original div.

The Problem:

Everything works perfectly unless the user makes changes to the text in the div and then immediately clicks on a Drop down menu box which also has an onChange javascript event attached to it. Even if the user makes changes to the text and then clicks on the drop down menu the changes are being submitted properly and updated in the database, but the response from the AJAX with the marked up text is not getting written out to the div.

The Bottomline:

Bottom line is that one javascript function is interrupting the response of another. How can I get the javascript function on the div to complete before it tries to execute the javascript function on the drop down menu?