wood burning stoves 2.0*
The moose likes Struts and the fly likes <html:select>box 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 » Frameworks » Struts
Bookmark "<html:select>box validation" Watch "<html:select>box validation" New topic
Author

<html:select>box validation

unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23
Hi Guys,

Greetings!!

Can you please help me to validate <html:select> box in struts1.3. I just need to say error message like 'required' if one who is not selecting the list on form submission

Cheers!!!
Unnii
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

How are you doing your validation? This sounds like a simple "required" validation.
unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23

i am using javascript validation like the following:

validation.xml:



put an entry in jsp like :



and entry in resource file


its working for contactname but not for country..

can you please help me ??

Cheers!!
Unnii
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You'll have to show the form code.

AFAIK the JavaScript will work for both single- and multiple-select boxes.
unnii
Greenhorn

Joined: Jan 21, 2008
Posts: 23
this code is to fetch countries from DB. I need to ask the customer to select Country as mandatory field



What should i do to validate country select box??
 
 
subject: <html:select>box validation
 
Similar Threads
Pass select box value from jsp to action class
How to display the last item of a select box as default
html select box
Drop down list value
drawdown select box in strruts