Yet another blog (hopefully a useful one though)
Posts tagged ajax
Ajax filled form field errors in firefox and some IE wierdness too
Nov 14th

I spent ages looking for the answer to this one and it ended up really simple so I thought I would share it.
We had a web form where a select field was chosen. Then a second select was populated by ajax depending on the value of the first select. All pretty standard except that in firefox the second select just disappeared! After a whole bunch of wild theories about form encoding and other crazy stuff it turned out that the problem was in the validation. In order for a form to be valid XHTML the <form> tags have to lie OUTSIDE the <table> tags. When this is done wrong firefox, being pernickety, decides that as the code is not valid and the page was built dynamically it cannot cope so ignores the second <select> completely. All very stupid!
As for IE, we found out today that if you AJAX in only the <option> tags the second select will not work. However if you AJAX in the whole <select> it does! Crazy!