I'm primarily a php dev but I'm writing a pretty simple system for a client of ours to allow them to put details of meetings on their site. Given that it's a pretty straight forward project I decided to dip my toes into the world of DHTML and the DOM to give the thing some extra functionality.
However I'm having some serious trouble getting it to behave in IE(surprise, surprise!)
Here's how it is at the moment:
When you click on the "add another category" link it adds an extra category with 1 field for adding papers and a button for selecting the papers from a popup. When you update the field for papers it adds an extra 'papers' field in that category if there aren't any more available.
The problem is that the event handlers aren't working for any of the dynamically generated HTML in IE.
Of course everything works fine in FF...
Anyone any ideas?
less trouble with DOM if you use CSS to format the form, less elements to generate too.
But the IE problem maybe because of missing <tbody> element in your table, wrap each new row in <tbody>
I did a lot of digging and sussed it out. Basically you have to use:
object.event = function;
This means you're passing the function by reference so to get whatever object calls the function from within that function you'd use:
It's a little bizarre to say the least! If anyone can explain what the heck is going on there I'd be intrigued...
var id = this.id;
And yeah i'll probably switch it over to css now that I'm happy that I can get it to work.