struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "semaj.najraham" <semaj.najra...@hotmail.com>
Subject Using Nested tag and JavaScript
Date Thu, 02 Aug 2007 15:42:41 GMT

Hey guys,

I need some help using nested tag library and javascript.  I have an
actionForm named RegistrationForm that has two AddressForm; mailing and
billing addresses. I need to implement a requirement if a user clicks a
checkbox say 'same as mailing', I need to copy the textfield values from
mailing address to billing address.

I can easily use the javascript something like this:

function copyMailingAddress {
 if (document.forms[0].copyMailCB.checked)
 {
   document.forms[0].billingLine1.value =
document.forms[0].mailingLine1.value;
   .........
  }
}

The only problem I'm having is to use it with nested tag library.
In my jsp, I have following code

<nested:nest property="mailingAddress">
 <nested:text property="line1" />
 <nested:text property="line2" />
 .....
</nested:nest>

Similarly,

<nested:nest property="billingAddress">
 <nested:text property="line1" />
 <nested:text property="line2" />
 .....
</nested:nest>

When this jsp is rendered as html, the code will something like this:
<input type="text" name="mailingAddress.line1" value="">
<input type="text" name="mailingAddress.line2" value="">

<input type="text" name="billingAddress.line1" value="">
<input type="text" name="billingAddress.line2" value="">

Now how can I copy the values from mailingAddress to billingAddress using
above JavaScript? The dot in between name prevents to execute the above
javascript...

Could anybody point me how I can resolve this problem?

Thank you,
semaj
-- 
View this message in context: http://www.nabble.com/Using-Nested-tag-and-JavaScript-tf4206847.html#a11966912
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message