• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Validation of Html options

 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone help me of how to validate html ptions? This is my code



What should I put in validation.xml and validation-rules.xml files if I need validate the field for "required"

Thanks in advance.

Lk.
 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try the following.

<html:select property="category" style="width:155px" tabindex="12">
1opt<html ption value="" >- - - -Select- - - - </html ption>2opt<html ption value="...">...</html ption>
3opt<html ption value="...">...</html ption>
4opt<html ption value="...">...</html ption>
5opt<html ption value="...">...</html ption>
</html:select>

Observe the above code.Don't provide the value to 1opt(first option).It'll work fine.

Regards
Suri.
 
sureshreddy puli
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Modify your code as the following.

 
Luke Zechariah
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Sureshreddy,

Thanks for the reply. But still I am getting the following error, if we validate html ptions. I have searched the complete forum and so many of my friends had the same error and looks like none got the answer for this.

Following is the error:



 
Luke Zechariah
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,

Just now found out the answer of how to validate html ptions when we get the error "Cannot find bean under name clmTypeList"

Make an Actionform class "Testng1" where the ArrayList is populated.



In the Action Class put


In the jsp file file put


It should work.

Thanks,
Lk.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic