Hi People,

I usually like to access form elements using their names ( rather than ids) as 
I find it more readable.
So, if I had a field named 'street' on a form named 'addressForm'  I can access 
it using something like document.addressForm.street 

Now, I am using struts 2 and its OGNL support to inject parameters directly 
into objects contained exposed by my actions.

So, I might have a form with a field named 'address.street'.
When this form is submitted the fields value is set by the parameters 
interceptor using something like action.getAddress().setStreet()

Unfortunately, this means that my method of accessing form fields in javascript 
no longer works because the last period
in document.addressForm.address.street is not interpreted by javascript as part 
of the name, but as the javascript de-reference operator.


does anyone know of a solution to this? Can I escape that . in javascript 
somehow? Can I change what character OGNL uses?

I realize I could place ids on my fields and use getElementById, but as I said 
I would rather be able to use this syntax for readability's sake.

cheers
Perryn

"This e-mail and any attachments to it (the "Communication") is, unless 
otherwise stated, confidential,  may contain copyright material and is for the 
use only of the intended recipient. If you receive the Communication in error, 
please notify the sender immediately by return e-mail, delete the Communication 
and the return e-mail, and do not read, copy, retransmit or otherwise deal with 
it. Any views expressed in the Communication are those of the individual sender 
only, unless expressly stated to be those of Australia and New Zealand Banking 
Group Limited ABN 11 005 357 522, or any of its related entities including ANZ 
National Bank Limited (together "ANZ"). ANZ does not accept liability in 
connection with the integrity of or errors in the Communication, computer 
virus, data corruption, interference or delay arising from or in respect of the 
Communication."

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

Reply via email to