jquery-validate

jQuery.validator.methods.required()

hello, my code is : $.validator.addMethod("dateBR", function dateBR(value, element) { return /^(?:(?:(?:0?[1-9]|1\d|2[0-8])\/(?:0?[1-9]|1[0-2]))\/(?:(?:1[6-9]|[2-9]\d)\d{2}))$|^(?:(?:(?:31\/0?[13578]|1[02])|(?:(?:29|30)\/(?:0?[1,3-9]|1[0-2])))\/(?:(?:1[6-9]|[2-9]\d)\d{2}))$|^(?:29\/0?2\/(?:(?:(?:1[6-9]|[2-9]\d)(?:0[48]|[2468][048...

Combining MicrosoftMvcJQueryValidation and Ajax Submit

Hi all, I'm having troubles trying to apply MS JQuery Validation in my forms where I want to submit data via an Ajax call. I am using DataAnnotations and MicrosoftMvcJQueryValidation.js library to perform client-side and server-side validation. Server validation works great and I'm trying to enable Client validation by mean of <% Htm...

Icon on ui tabs (validate)

I am trying to add an icon on ui tabs when validate fails. Which method should i use (option is my guess). Can anyone help me. Thanks ...

jQuery Validation plugin attaches only to the first form

I have noticed a strange jQuery Validation plugin behaviour, possible a bug (tested with the latest version at http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js). Suppose I have several forms on a page. This code leads to only first form to be validated: $(document).ready(function() { $("form").validate(); }); ...

Getting a Error with Jquery.Validate Plugin in IE 8

Hi I don't know what is going but my jquery validate plugin(1.5.5) is not working and I am not sure for how long since I do most of my testing on firefox. The problem is this I go to one of my forms that jquery validate on it and hit my "create" button my validation kicks in as it should and does this right in all browsers including IE...

First letter should not be a number using jquery

Hi, I am new to jquery and creating login form.One of the condition for the 'user name' is that, the first letter should not start with a number. How to do this using jquery? thanks in advance. ...

jQuery Validation on field(s) with a prefix in the name property

Hi guys, I'm trying to add the jQuery Validation plugin to some websites and I'm running into a bit of an issue in that the fields that it's supposed to validate have a prefix on the name property, such as "Customer.FirstName". Since you have to pass a JSON object to the validate function for the rules, it doesn't work because it never...

JQuery validation plugin - error highlight problem

I have a form with two input textboxes, and I have included jQuery validation rules for both: <script src="../../Scripts/jquery-validate/jquery.validate.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { $('#respondForm').validate({ onclick: false, onkeyup: false, onfo...

Jquery validation: submit the form with javascript with no validation

Hi, i'm just using the JQuery validation plugin. i have the following spec: 'if the form isn't used in 10 seconds, give the user a warning, if he doesn't do anything, submit it anyway' besides the timer etc. i have this code to submit the form: timeoutId = setTimeout(function() { $("#session_expired").val("true"); $("form:first").val...

jQuery Validation: validate atleast one checkbox is selected from a list where names are different

I need to validate that atleast one check box is selected from a list of checkboxes using jQuery Validation Plugin. Since the checkboxes are part of a ASP.NET GridView Control, the names of these checkboxes will be different, which makes setting up the rules for the validation plugin complex since it expects the name for the rule. I have...

jQuery form field checklist

Hey there, I have a form and wish to display a checklist which will just be a list of items to show the user which sections have been completed. I want to be able to apply a css class to each list item that will show a tick or cross depending on whether those form fields have been completed like so; <ul class="summary"> <li class="...

JQuery Validator Plugin

I have managed to implement the validator on a form, and is working fine for all my needs apart from a crucial last one. Does anyone know how I would go about (or whether it's even possible) to extend or create a validation message that is purely a warning but still allows the form to be submitted (i.e. the field is still valid). To il...

jQuery - Getting custom validation methods to trigger

If I've added a custom validation method to my form, how can I get it to trigger prior to submit? I'm not decorating my form fields but I thought that adding the new method to my rules section would trigger the method but it doesn't work. $.validator.addMethod('myCustomValidation', function (data) { // do some work here return ...

JQuery validation plugin - custom validation for group of html elements

I have a set of combo boxes on a HTML form which act as a Date control: <div id="datecheck"> <select id="datecheck_y" name="datecheck_y"> <option value="2009">2009</option> <option value="2008">2008</option> <option value=""></option> </select> <select id="datecheck_m" name="datecheck_m" > <option valu...

Dependency mismatch problem with Jquery

Hi, I am pretty new to Jquery, I am using validation rule against my textbox. The problem is when i mark textbox is mandatory n user doesn't input any value then it doesn't show any validation message. I have associated another validation message for textbox tht the value shu be in range and which works when user provides any input. $.v...

xVal and remote validation rules with empty values

I have a textbox.. <input id="state" name="state" type="text" value="" /> And I'm trying to add a remote rule to it. <%= Html.ClientSideValidations() .AddRule("state", new RemoteRule(Url.Action("ValidateNeedForState")))%> In that remote action I want to see if the country is "US" and if so, make sure there is a state provided. ...

get attribute value of a selected node/element in jquery

Can somebody tell me how to get attibute value of a selected node/element in jquery. $.extend($.validator.messages,{ required: = $(element).attr('ErrorMessage');} }); I have tried the above code but it doesn't work. My element contain attribute called ErrorMessage which I want to retrive to show the custom error message. Whenever u...

how do i use the jquery validation plugin to conditional validate

Hi, I am using the bassistance jquery plugin validation. I have a drop down list with 2 values. If the first value is selected by the user a valid datefield needs to be populated and if the second option is selected then a textbox needs to be filled with some text. If nothing is selected then it need to return a validation on this as...

Why doesn't jQuery form validation plugin work in my page?

Why does not jQuery form validation plug-in work? This is the code: <form id="form2" action="comment.php?id=5" method="post"> <div>Input your own comment:</div> <textarea id="textarea2" name="textarea2" rows="3" cols="29"></textarea><br/> <input type="submit" value="Submit"></form></div> <script type="text/javascript" src="http://de...

WordPress Contact Form 7: Send button does not submit, redirects to same page (jquery / anchor navigation)

I am developing a WordPress page that uses a jquery.slideto.js navigation system and html anchors. I am using the Contact Form 7 plugin When pressing the "send" button, the form does not submit, and the included jQuery validation script does not fire. Instead, it just reloads the current page without submitting. I have included the ...