Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
Hi,
I wan know about the jquery validation -----

         jquery validation for drop down with default value as "0".

         Also have to validate cascading drop downs using jquery ...
Posted 19-Feb-12 21:48pm
IndiaMH353
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Comments
IndiaMH at 20-Feb-12 3:40am
   
Hi,
I already tried for this this things
http://forum.jquery.com/topic/need-help-with-jquery-to-validate-dropdown-list[^]

But it doesn't work for me...

Here is my code sample
jQuery.validator.addMethod("notEqual", function (value, element) {
return value != param;
}, "*");

$(document).ready(function () {
jQuery.validator.messages.required = "*";
$("#form1").validate({
rules: {
ddlSample: {
//required: true,
notEqual: "- - Select - -"
}
messages: {
ddlSample: {
//required: "*"
}
}
});



Have any other solution for it
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Set one options value as "".

Refer this:

To force a user to select an option from a select box, provide an empty options like <option value="">Choose...</option>

From : Plugins/Validation/Methods/required[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I Think This IS The Best :

See its source.

jQuery Validation Plugin Demo[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 165
1 Sergey Alexandrovich Kryukov 134
2 Sebastiaan Meijerink 131
3 Rana Waqas 110
4 Maciej Los 84
0 Sergey Alexandrovich Kryukov 6,558
1 OriginalGriff 6,288
2 Peter Leow 2,534
3 Abhinav S 2,358
4 Maciej Los 2,352


Advertise | Privacy | Mobile
Web03 | 2.8.150414.1 | Last Updated 20 Feb 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100