Very true. I just wanted to point out the standards-compliant way in case it wasn't known... You pointed out the reality, which is excellent info :)
Frank -----Original Message----- From: "Nitesh"<[EMAIL PROTECTED]> Sent: 6/27/05 1:40:03 AM To: "Struts Users Mailing List"<user@struts.apache.org> Subject: Re: javascript html:fprm and getElementById getElementById is indeed the "standards-compliant" method... but something which came in a bit late!!! Browser IE 5+ and Netscape 6+ support them... but the earlier version browsers does not support getElementById (since these browsers date before the standard was introduced. Also the standard practice followed for manipulating forms in the HTML document using JavaScript is the form array/object rather than getElementById. (Doesn't mean that you cannot/should not use getElementById) getElementById is introduced keeping in mind the DHTML parts and as a standard way to access the DOM elements which were not exposed as arrays/object for JavaScript. For e.g.. accessing the table cells/rows or DIV/SPAN elements etc to bring in DHTML effects. HTH, Nitesh Naveen ----- Original Message ----- From: "Frank W. Zammetti" <[EMAIL PROTECTED]> To: <user@struts.apache.org> Sent: Monday, June 27, 2005 10:39 AM Subject: RE: javascript html:fprm and getElementById > Remember that getElementById is the "standards-compliant" method, the > others are not, IIRC. They of course work too, but when manipulating DOM > objects, getElementById is supposed to be used, according to the current > standards. > > Is there such a thing as casting in JS? I'm not sure. I don't think > there is as far as object references go anyway, but I could be wrong. > > Frank > > -----Original Message----- > From: "Nitish Kumar"<[EMAIL PROTECTED]> > Sent: 6/27/05 12:37:42 AM > To: "'Struts Users Mailing List'"<user@struts.apache.org> > Subject: RE: javascript html:fprm and getElementById > > > I geuss, some thing working or not working in JavaScript is a lot > dependent > on what version of what browser, are you using. > > Well, Any ways, from my previous experience with JavaScript, usually > > document.getElementById gives you an object, and casting it to form > doesnt > work all the time.. > > it is always better to use document.forms[i].action . > > > Thanks and Regards, > Nitish Kumar > > > > > -----Original Message----- > From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] > Sent: Monday, June 27, 2005 3:05 AM > To: Struts Users Mailing List > Subject: Re: javascript html:fprm and getElementById [Message truncated. Tap Edit->Mark for Download to get remaining portion.] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]