This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes Validating struts index property element in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating struts index property element in javascript" Watch "Validating struts index property element in javascript" New topic
Author

Validating struts index property element in javascript

Darvesh Niz
Ranch Hand

Joined: May 12, 2008
Posts: 119
HI
i have an action which has an array list element of marks and i am displaying as indexed property on my form so my form will have multiple marks elements indexed
<tr>
<td>Rollno</td>
<td>Kapoor K Min (minni)</td>
<td><input type="text" name="student[0].marks" size="30" value="0"></td>
</tr>

<tr>
<td>Rollno</td>
<td>Kapoor K Min (minni)</td>
<td><input type="text" name="student[1].marks" size="30" value="0"></td>
</tr>


<tr>
<td>Rollno</td>
<td>Kaporr K Kin (kinni)</td>
<td><input type="text" name="student[2].marks" size="30" value="0"></td>
</tr>

What i wanted to know how to reference this in javascript for example if i want to see the second indexed mark elemetns has some valid value instead of zero. is there a way to do it. Please let me knwo asap

Thanks
Rashid
[ May 12, 2008: Message edited by: Bear Bibeault ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In JavaScript there are usually at least a half dozen ways of doing the same thing. Here's one.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validating struts index property element in javascript
 
Similar Threads
text field validation
Struts 1.x, 2, jstl questions
why document.getElementById work with form elements
Can't pass changed beans values from one JSP page to another
calculating form fields