Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validating struts index property element in javascript

 
Darvesh Niz
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JavaScript there are usually at least a half dozen ways of doing the same thing. Here's one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic