jquery-validate

JQuery Validator Plugin Asp.Net call server method

I use the JQuery Validation plugin to validate a form (http://docs.jquery.com/Plugins/Validation/) For example, I can validate an email in a form. What I would like to do is to validate if the username chosen already exists. So, I need to call a server method that query the database. How can I do that ? UPDATE From balexandre answer,...

Form in ASP.NET MVC (1.0) does not fire if "id" attribute is present (jQuery Validation requirement)

<% Html.BeginForm("Index", "Home", FormMethod.Post, new { id = "form_logon" }); %> or <form id = "form_logon", action="/Home/Index" method="post"> just don't work. Pressing a submit button if ID is present does nothing, while id is required for jQuery validation plugin. ...

Asp.Net JQuery Validation Custom Rule

i try to customize the rule of the JQuery validation plugin and I'm almost done. The only problem I got is that the function $("<%=txtUserl.UniqueID %>").val() return undefined. How can I get the value of that textbox ? $("#aspnetForm").validate ( { rules: { <%=txtUser.UniqueID %>: { ...

JQuery Validation - Print message when field is valid

With the JQuery Validation Plugin is it possible to print 'Ok' when the field is correct? When there's an error, I can show a customizable error message. Is the same thing possible when there's no error in the field and it's content is valid (I mean it's not empty) ? UPDATE Here's an example of what I want to achieve : Example. When th...

JQuery validate plug in: Why will this select menu not validate() ?

I Have a large form with hidden divs, an initial select menu reveals the appropriate div (reduced to just one option here for brevity)... when that containing div is made visible I want to use the validate plugin to validate the next select menu. I use this rule, which works for the initial select menu salesProduct: { required: "...

Need jQuery.validate to prevent Ajax form submission

I'm using the jQuery.validate() to validate my form before it is submitted. Now that I am using Ajax to submit my form, I have a problem. Note: I am not using the jQuery form plugin. Just so that is clear :) The jQuery.validate() is fired, but the form submission is also executed. I don't want the form to be submitted until the valida...

How to manually trigger validation with jQuery validate?

I want to manually trigger validation including showing error messages with jQuery Validate. The scenario i am trying to accomplish is a form like this: <form> <input id=i1> <button id=b1> <input id=i2> <button id=b2> </form> When clicking b1, only i1 should be validated. hen clicking b2, only i2 should be validated. However all fi...

jquery validation without FORM

How to validate a bunch of fields that are not enclosed by FORM tag using jquery validate? ...

jQuery validate plugin with event.preventDefault()

I have a page that has a Contact Form slide down when a link is clicked (i.e. it is a div on the page that displays with .slideDown('slow') I have the jQuery validation plugin working on the contact form, only I noticed that when I was testing I had event.preventDefault(); commented out. In the final version I want that to be uncomment...

jquery validate - fail on radio

Hi, I have a form that's checked by jquery validate. The field that's causing some issue looks like this: <label>Select an Account Type<</label><br> <input type="radio" name="accountType" value="1" id="accountType_C"><label id="accountType_C" for="accountType_C">Coder</label> <input type="radio" name="accountType" value="0" id="accou...

JQuery UI Dialog + JQuery Validate + Tabbing

Hi I have a jquery ui dialog with a form inside. If I call the validate method of the jquery.validate plugin, tabbing inside the form fields strangely submits the form. If I remove the call to validate, the odd behaviour dissapears, but then I would have to validate by hand. Any ideas why? Can't post code right now, but could create...

jquery validation with ajax call

I am using the jquery validation and i need to validate an email. I use $("#myForm").validate({ rules: email: { required: true, email: true } }) SO FAR so good. The problem is that i need to make an ajax call to verify if given email already exist.If exist display message "This email already exits....

jquery validate fields came from ajax call

Hi i am trying to validate a form with jquery validation and at the same type validate form fields that came from an ajax call. Here is the situaton <input type="radio" onclick="load extra fields 1"> Radio 1 <input type="radio" onclick="load extra fields 2"> Radio 2 So when i select one radio i get bellow extra fields and i want to v...

Do not display validation error messages with jQuery Validate

I'm using jQuery Validate, but I really don't want to have any error messages whatsoever. Rather, I need to have red boxes around offending inputs/selects/etc. These red boxes were a piece of cake to add, but I still cannot remove error messages themselves. How do I disable them altogether? ...

jQuery Load problem in Internet Explorer

I am having troubles with jQuery's load function and am hoping for some help. I just started testing a site I built in IE to debug/hack/etc to make sure it works. Firefox/safari/etc all work great. .load won't work for me though. It just seems to hang. Would love some help. Here is a simplified version of the problem: <!DOCTYPE HT...

Jquery blockUI + Validate plugin - Validation not firing

Context: Using Asp.net 2.0 webforms, Jquery 1.3.2 and BlockUI and Validation plugins. I have a Gridview which is databound with some html buttons and then these buttons are wired up in jquery so that when clicked, blockUI displays a div with various inputs. When the modal is submitted, I am using the Validate plug-in to validate the inp...

How to perform validation on sumbit only - JQuery Validation plugin

I want the JQuery validate plugin to only display the validation messages only upon form submit and not when the focus from a input field is lost. How do i achieve this? Right now I am following this pattern, which leads to validation after lost focus event: <html> <head> <script> $(document).ready(function(){ $("#commentForm")....

What is the proper way to do multi-parameter AJAX form validation with jQuery and ASP.NET MVC?

I have a registration form for a website that needs to check if an email address already exists for a given company id. When the user tabs or clicks out of the email field (blur event), I want jQuery to go off and do an AJAX request so I can then warn the user they need to pick another address. In my controller, I have a method such as ...

Why is the wrong field value shown in the error message when using jQuery (remote) validation?

I'm using the jQuery validation plugin in a very similar manner to the Remember The Milk demo. $("#registrationForm").validate({ rules: { email: { required: true, email: true, remote: '<%=Url.Action(...) %>' }, }, messages: { email: { required: "Please enter an email address", ...

jQuery Validator custom method

Hi all, could you take a look at this http://jsbin.com/osolo/ please? If you enter a letter in Min Age rather than a number then hit submit this validates using jquery validator using a regular expression in a custom validation method, this works but i'm now looking to make it a little more dynamic. In the custom validation method...