1 (edited by MAX232 2007-03-28 3:44:47 PM)

Topic: Check the frm variable in getFormValues()

Hi All,

In one xajax implementation I searched a full day for a problem I had with xajax in IE and not in FF. After debugging a while I found out that IE passed a different id to getFormValues() then FF. It appeared I had used the id twice in one page (although W3 did not notice), one was the actual form and the other one was an IFRAME. I then added a few simple lines to getFormValues. The 'if' condition used to test if the incoming variable 'frm' actually was assigned to a form had no 'else'. I added the else with an alert() message. So when I somehow end up using the same id twice the getFormValues will warn me instead of leaving me with debugging.

This is especially practical when other js scripts dynamically assigns id's, it's harder to track where all your id's go.

Just a small tip!