[thelist] Forms and getElementById

Rob Whitener rwhitener at DesignOptions.com
Wed Jan 29 10:27:01 CST 2003


I am developing on a windows platform, and the only browser I have right now
is IE 5.5.
I am going to try and change the names of the images.  I thought using the
id property for images and the name property for the elements wouldn't cause
any confusion.

Thanks,

Rob

-----Original Message-----
From: Peter-Paul Koch [mailto:gassinaumasis at hotmail.com]
Sent: Wednesday, January 29, 2003 11:21 AM
To: thelist at lists.evolt.org
Subject: Re: [thelist] Forms and getElementById




>I am having a difficult time with something that should be simple.  I have
>a form and I have two javascript functions that I want to use to validate
>this form.  One to check the validity of an e-mail address, and one to make
>sure all of the fields have a value.  The problem is, if there is an error
>on the form, I have an image of a red arrow hidden next to each textbox
>which I would like to make visible.  I have set id's for all of the images
>to be the same as the names of the form elements they correspond to.
>However, when I try to use getElementById, I can't get the image tag,

Which browser? IE Windows returns the element with name="test" if you ask
for getElementById('test'). If this problem only comes up in IE Win, change
the names of the images.

I think you should change them anyway, for instance by adding '_img' to the
form field name.

--------------------------------------------------
ppk, freelance web developer
Interaction, copywriting, JavaScript, integration
http://www.xs4all.nl/~ppk/
Column "Keep it Simple": http://www.digital-web.com/columns/keepitsimple/
W3C DOM Compatibility Table, expanded & updated
http://www.xs4all.nl/~ppk/js/index.html?version5.html
--------------------------------------------------


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !



More information about the thelist mailing list