Results 1 to 3 of 3
  1. #1
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up 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 07:12 AM. Reason: code reason

  2. #2
    Poonam is offline Member
    Join Date
    Nov 2007
    Posts
    15
    Rep Power
    0

    Default

    Hi, U can validate property <html:select property=...>

    check length or not null for this property.

  3. #3
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up

    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

  1. radiobutton selection
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 03-17-2008, 03:58 AM
  2. Validating email address!
    By rameshraj in forum Advanced Java
    Replies: 1
    Last Post: 02-18-2008, 10:39 AM
  3. Validating email address
    By ravian in forum New To Java
    Replies: 2
    Last Post: 12-21-2007, 09:42 AM
  4. validating a string for numbers and letters?
    By lockmac in forum New To Java
    Replies: 1
    Last Post: 08-09-2007, 10:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •