File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Javascript in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Javascript in Struts " Watch "Javascript in Struts " New topic

Javascript in Struts


Joined: Jul 10, 2002
Posts: 2
I have a page which uses a logic:iterate tag to display a table containing a number of fields.
One of the columns in the table is a checkbox.
Here is my requirement:
When the user clicks on the checkbox, I want a value in one column of that row to be copied over to another column in the same row.
I want to do this using Javascript but I do not want to use the Validator plugin as that may cause a lot of changes in our existing functionality.
Is there some way in which I can write the Javascript?
Thanks & Regards,
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
JavaRanch has a naming policy which is strictly enforced. Please read the policy and change your display name if you wish to continue posting here.
You can change your name: here

Matthew Phillips
Ravi Veera
Ranch Hand

Joined: Jun 23, 2001
Posts: 127
Use the Checkboxes onclick/onchange attribute to make a call to a Javascript function.
something like
<html:checkbox property="something" onchange= "copyValue(...)">
I agree. Here's the link:
subject: Javascript in Struts
It's not a secret anymore!