May be u can try something like this

var doneForm = document.getElementById('doneForm');

doneForm.elements['data.fieldName'].value

-Anil


-----Original Message-----
From: Nocera, Robert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 1:47 PM
To: Struts Users Mailing List (E-mail)
Subject: Struts and Javascript question


Hello all,

I was wondering if anyone knows how to access a form element in javascript
that has a "." in the name of it.

For example, if I have a data bean included in a form beanm, I can access
fields in the data bean through tags using the "." notation as:
<html:text property="data.fieldname" />
This create an input text box with the name "data.fieldname".
How can I access that object in Javascript?

var mydataobj = document.formname.data.fieldname;

doesn't work because the dot seems to be throwing off the parser (at least
in IE 5.0).

Any ideas besides creating an accessor in the form bean itself?

Thanks,
Rob


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be
privileged. It is intended for the addressee(s) only. Access to this E-mail
by anyone else is unauthorized. If you are not an addressee, any disclosure
or copying of the contents of this E-mail or any action taken (or not taken)
in reliance on it is unauthorized and may be unlawful. If you are not an
addressee, please inform the sender immediately.

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to