Choopernickel
12-17-2003, 07:19 PM
Developing a ridiculously dynamic form, here's a temp copy: http://www.10mar2001.com/temp/formUI/ - the scripting is in this external file: http://www.10mar2001.com/temp/formUI/formUI.js
I'd like to draw your attention to the Delete member button. It's kind of nasty what's going on back there behind the scenes, but when it's clicked, I perform these steps:
- Detect which button was clicked (by parsing its ID)
- Delete the row that button's in
- Loop over the rows in the table after the one that was deleted (including the one that takes its place)
- During the loop, rename the button so that its ID parsing will trigger the delete of the proper row (i.e., the one it's in)
This is probably just as convoluted as it sounds, but I haven't really been able to figure out a better way to provide this kind of dynamicism on a form. If you've got a suggestion, I'm open to it.
It works just fine in IE6 (I'm not trying to make it work in anything lower, just it and Firebird .7 at this point), but in Firebird, this happens:
(First, you may wish to click the Add member button a few or several times.) When you first delete a row, it's all fine and dandy, and renames the elements exactly right. The second time you click a delete button, its row is deleted, but the elements which are told to be renamed are not renamed. The third time a delete button is clicked, each button which should be renamed just loses its text, nothing more. Once a button has no text in it, if it's clicked, its row is deleted, and no renaming happens.
I have not coded this for IE. I have not coded this for *any* browser, and I believe my scripting reflects that. I have some IE-specific workarounds, because of its lack of DOM2 event use and its oddness regarding the dblclick event, but other than that, it should be perfectly fine.
Has anyone else seen this kind of thing happen in Firebird?
edited to add: Though I hadn't tried it in Opera 7 before I posted, I haven't changed a thing and it works like a freakin' charm. Why Firebird? What have I done?
I'd like to draw your attention to the Delete member button. It's kind of nasty what's going on back there behind the scenes, but when it's clicked, I perform these steps:
- Detect which button was clicked (by parsing its ID)
- Delete the row that button's in
- Loop over the rows in the table after the one that was deleted (including the one that takes its place)
- During the loop, rename the button so that its ID parsing will trigger the delete of the proper row (i.e., the one it's in)
This is probably just as convoluted as it sounds, but I haven't really been able to figure out a better way to provide this kind of dynamicism on a form. If you've got a suggestion, I'm open to it.
It works just fine in IE6 (I'm not trying to make it work in anything lower, just it and Firebird .7 at this point), but in Firebird, this happens:
(First, you may wish to click the Add member button a few or several times.) When you first delete a row, it's all fine and dandy, and renames the elements exactly right. The second time you click a delete button, its row is deleted, but the elements which are told to be renamed are not renamed. The third time a delete button is clicked, each button which should be renamed just loses its text, nothing more. Once a button has no text in it, if it's clicked, its row is deleted, and no renaming happens.
I have not coded this for IE. I have not coded this for *any* browser, and I believe my scripting reflects that. I have some IE-specific workarounds, because of its lack of DOM2 event use and its oddness regarding the dblclick event, but other than that, it should be perfectly fine.
Has anyone else seen this kind of thing happen in Firebird?
edited to add: Though I hadn't tried it in Opera 7 before I posted, I haven't changed a thing and it works like a freakin' charm. Why Firebird? What have I done?