Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

text field validation

 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using struts 1.1 .

I have 5 columns(Product Description Nett Price (W/o Tax) Quantity UOM Nett Weight ) and 10 rows in my table. I am generating the text boxes using DynaActionForm and <logic:iterate>

I want to validate the columns as follows:
If i enter anything in Product Description, then the remaining columns must not be empty.

I have tried the following but the problem with it is that it is validating only the first row.

struts-config.xml:



AddPOBean:

jsp:


generated html code:



What should i do?
Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ids are singular. You can not have multiple elements with the same id.

Also you will have to loop through each row of elements and check it. One general if statement will not cover all of the elements.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic