Ryan Jameson (USA) wrote:
There is a function called "MM_findObj" which does exactly what you need. I believe it originated from the Macromedia company (hence the MM prefix) - possibly used by Dreamweaver for its scripting purposes, but I digress.
Below is the funtion, and whenever you want to refer to oddly named form elements, you call MM_findObj('oddlyNamedFormElement') (and it returns an object reference to the form element that you can use normally).
[snip] An addendum to that, two points: (mixed js and html examples, patently obvious which is which though)
1) You can use this for more than just form elements, if you give an item an id. e.g.
<div id="my_great_div">hello world</div>
h8_ie_my_great_div = MM_findObj("my_great_div");
2) This is just a general warning, but I used to stumble into it a lot. IE creates variables/objects in the document namespace, essentially polluting it - good for convenience, bad for cross-browser anything. As an example:
can be used as just "nothing" e.g.:
... and in fact, you get errors when you try to do things like:
nothing = MM_findObj("nothing");
h8_ie_nothing = MM_findObj("nothing");
- Martin Norland, Sys Admin / Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital.
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php