Internet Exploder, I hate you so much

Yesterday was a fun day in the continuing struggle against IE brokenness.

First problem: the form submit button used to work on IE, but now it doesn’t. Well, no matter, because the form had an onsubmit that did some AJAXy stuff and then cancelled the form submit. Rather than wasting time trying to figure out why it works on real browsers and not on IE, I just changed the submit button into an ordinary button that invoked my function. Problem solved.

Second problem: My form is very dynamic, allowing you to add, delete or clone table rows, each of which contains several select, checkbox, and textarea input fields, all with associated onchange or onclick callbacks. The problem was that when you cloned a row, the callbacks on the new row would apply to the original row. All the callbacks had the row id in the arguments list, and when I clone I use the jquery attr command and a regular expression to change the row id. That works for real browsers, and it apparently works in IE (if you examine the code in Firebug you see the new id), but apparently the actual callback data is stored internally somewhere. It didn’t seem to matter whether I called clone with true or false in the copyData argument. So I restructured all my callbacks so the were activated by the jquery on command, and grabbed the row id and other arguments using the jQuery(this).parents('tr').

It was annoying to have to do all this stuff because IE is so different from real browsers, but the code is probably better for it.