jquery-validate

How can I check for exact length using jQuery Validation?

Using the jQuery Validation plugin to validate forms, how would you confirm that a string is exactly X characters long? ...

[WebForm] Validation using jQuery.validate.js (plug-in)

I want to Validate almost just one field from two is required for client submit. something like groupValidation property for make their exclusively dependent on validation postback Im using ASP.NET Webforms - C# 3 ...

jQuery.validate.js and asp.net master pages

I have jQuery in various files, and recently I have needed to change items in the master page. This has caused various jaavscript includes to stop working. Stackoverflow are suggesting great ideas to solve the issue regarding the get by ID selector. $("#ctl00_ContentMainPane_eliteUser").html However I have a problem where we have use...

Jquery Validation remote validation not working

Hi I am not sure what I am doing wrong I am using the Jquery.Validate plugin and it has a remote field so I did this $("#mainForm").validate( { rules: { UserName: { required: true ,remote: "Test" } ,messages: { UserName:...

jQuery validate less than

I am trying to write a "Less than" validator for jQuery. I want to compare one text box against another, so if I have: <input type="text" id="value1" /> <input type="text" id="value2" /> I want my validator to look like $('#myForm').validate({rules: { value1: { lessThan: "#value2" } } }); I have tried this but I can't get it to wo...

Reset Radio button after warning message

I have two radio buttons, one and two, if i click the radio button two, the warning message should appear and the button should be reset to one can you suggest some code for this ...

Applying AddMethod() to validation function

Hi I am new to jquery, I am trying to validate a group of checkboxes[] using the validation plugin. After searching the internet I came across this AddMethod( ) which seems to resolve the issue of checkboxes, but I can not find any piece of code that explains how to apply the new method name to the validate(). Here is my code of w...

JQuery Validate multiple fields with one error

How would I use the JQuery Validate plugin to have one error message for say 3 fields. For example 3 dob fields. By default I will get 3 error messages if all 3 fields are left blank. I only want one error linked to 3 fields. If any are blank the error comes up. ...

jQuery Validate - require at least one field in a group to be filled

I'm using the excellent jQuery Validate Plugin to validate some forms. On one form, I need to ensure that the user fills in at least one of a group of fields. I think I've got a pretty good solution, and wanted to share it. Please suggest any improvements you can think of. Finding no built-in way to do this, I searched and found Rebecc...

How can I verify that user name starts with a letter and contains only alphanumeric characters?

I am using Jquery Validation. Currently, I have a username, what i want to validate for this username is: Not blank Availability No whitespaces, I add this method: $.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, " No white space please"); Alphanumeric ...

jQuery Validation - Moving JS to External File and Passing Fields

I am trying to clean up some of the JavaScript throughout my views and one of the things I would like to do is move my jQuery Validation code to an external script function and pass in references to the fields I need to process/validate. The issue I am facing is pertaining to how the signature of jQuery Validate's rules field is formatte...

jQuery Validation plugin custom method. Multiple parameters.

I'm trying to use a custom validator with jQuery Validation plugin. However, I'm unsure how are you supposed to pass multiple arguments to a validation method? I've tried using (2,3), curly braces and combinations, but I have failed. This is the code - ???? marks the area I need info about: $(document).ready(function() { jQuery.valid...

validating start and end dates with jquery plugin: validation

hey all, i'm using bassistance jquery plugin validation and i have 2 textboxes for a start and end date. is there a way to setup a rule to say if either one is specified then require both fields, but the user can choose to leave both blank and that's ok? thanks, rodchar ...

remove messages programmatically in bassistance validator

hey all, i'm using jquery-validator (bassistance/de) with my jqmodal window entry screen. let's say i trigger a validation rule and hit cancel. the validation rule still appears. is there a reset or something to remove any messages if Cancel is clicked? thanks, rodchar ...

jQuery Form Validate() : How to setup default messages?

Until now, I've used jQuery validation plugin with previously defined fields. Now I'm working with a dynamic form. Fields have their validation needs mapped by its classes (e.g. " required "), but I don't see how to customize the messages jQuery validate throws. ...

jQuery Validate - can I re-validate a group of fields after changing one?

I'm using jQuery Validate and would like to re-validate a group of fields whenever one of them is changed (or possibly, whenever one of them validates successfully). My attempts so far just create infinite loops. Is this possible, or does the plugin design preclude it? (Specifically, I've got a method that requires at least X of group ...

how to validate this form in jquery

<form id="myForm" runat="server"> username <asp:TextBox ID="txtuser" runat="server"> </asp:TextBox> Password <asp:TextBox ID="txtpass" TextMode="Password" runat="server"> </asp:TextBox> <asp:Button ID="btnsubmit" Text="submit" runat="server" OnClientClick="Val()" /> </form> this is my source code anyone validate it or if anyone have a...

Adding jQuery conditional validation to dynamically-generated HTML

I have the following HTML scenario: <div> <input id="txt0" type="text" /><input type="checkbox" id="chk0" /></div> <div> <input id="txt1" type="text" /><input type="checkbox" id="chk1" /></div> <!-- etc --> <div> <input id="txtN" type="text" /><input type="checkbox" id="chkN" /></div> If checkbox N is checked, then textbox...

With JQuery Validation Plugin, I want to change the remote validation method

I'm using jquery validate plugin to validate an email address against a database using the remote method of this plugin. I need to check the email address is not in our database already. Originally, the script in combination with server side code simply checked for the email address in our database and returned true or false, this work...

jQuery Validation Enable Submit Button when Valid

I am using jQuery validation on my form and I would like to be able to disable the submit button and change its class, when the form validates. I know I could bind a function on the key up event but I want to know if this is possible from within the jQuery validate framework. I tried doing what this guy suggested, but got nowhere. I am...