This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes text field validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "text field validation" Watch "text field validation" New topic

text field validation

Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189

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.




generated html code:

What should i do?
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
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.

I agree. Here's the link:
subject: text field validation
Similar Threads
How to create text boxes using array/collections using struts tag
pass a variable in the URl
retrieve value of a field
set text filed values based on drop down selection
substitute for DynaActionForm in struts2