Results 1 to 3 of 3
- 02-10-2008, 05:54 AM #1
Member
- Join Date
- Dec 2007
- Posts
- 42
- Rep Power
- 0
validating selection list in struts!
Hello all,how can i validate the selection list in struts using validation.xml file.
I have the list populated in the following manner:
{code}<html:select property=...>
<html:option value="">Select your gender</html:option>
<html:options collection property=.....>
</html:select>{code}
If the user submits the page without selecting any options the default:"Select your gender" without any value will be posted and the validation should validate this and generate some error message on the same page.Last edited by rameshraj; 02-10-2008 at 06:12 AM. Reason: code reason
- 02-13-2008, 11:47 AM #2
Member
- Join Date
- Nov 2007
- Posts
- 15
- Rep Power
- 0
Hi, U can validate property <html:select property=...>
check length or not null for this property.
- 02-13-2008, 01:21 PM #3
Member
- Join Date
- Dec 2007
- Posts
- 42
- Rep Power
- 0
Actually I wanted the jsp page where the selection list is printed as the input page in the struts-config.xml file.I think u understand. I need to validate using the struts validate=true property from the struts-config.xml file and not directly comparing the value what was posted after selecting and submitting the page.
I have already implemented the logic u said. Any way thank u very much for your kind response.
Similar Threads
-
radiobutton selection
By newtojava7 in forum New To JavaReplies: 1Last Post: 03-17-2008, 02:58 AM -
Validating email address!
By rameshraj in forum Advanced JavaReplies: 1Last Post: 02-18-2008, 09:39 AM -
Validating email address
By ravian in forum New To JavaReplies: 2Last Post: 12-21-2007, 08:42 AM -
validating a string for numbers and letters?
By lockmac in forum New To JavaReplies: 1Last Post: 08-09-2007, 09:17 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks