File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 15385
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
It's not a secret anymore!