/ Published in: JavaScript
requires that a pulldown \\"program1\\" in form \\"freshmen\\" be set to anything but the first value in the option list. \r\n\r\nrequires jquery validate: http://docs.jquery.com/Plugins/Validation
Expand |
Embed | Plain Text
jQuery.validator.addMethod( "selectNone", function(value, element) { //alert(element.options.selectedIndex); //if (element.value == "blank"){ if (element.options.selectedIndex == "0"){ return false; } else return true; }, "Please select an option." ); $(document).ready(function(){ $("#freshmen").validate({ rules: { program1: { selectNone: true } } });
You need to login to post a comment.
