struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: pls help - > how to use document.getElementsByTagName inside html:text
Date Mon, 16 Apr 2007 21:54:52 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John,

john lee wrote:
> plain html file
>       <input type='text' name='part'>
>       i can use javascript to access "input" tag by 
>           document.getElementsByTagName("INPUT");
>    
>   but for struts html file
>       <html:text property="part">
>      i can not use javascript to access "input" tag by
>        either  
>           document.getElementsByTagName("INPUT");
>        or 
>           document.getElementsByTagName("HTML:TEXT");

Could there be a DOCTYPE issue here? My understanding is that
document.getElementsByTagName is supposed to accept a case-insensitive
string, but it's possible that my using a DOCTYPE of xhtml that you must
use lower case. Have you tried lower case?

If that doesn't work, try doing document.getElementsByTagName('*') and
iterating through them. Inspect the name of each element and see if
maybe there's another problem.

My last piece of advice would be to use document.getElementById whenever
possible in preference to document.getElementsByTagName.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGI/Cr9CaO5/Lv0PARAmcFAKCfm+E3JHPkniTuc/V+C/Co2Ie2wACeOs0l
NhsNDU33LsjxZ+A2sxGGMME=
=ZEHQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message