jquery-validate

Localizing jquery validation with asp.net mvc 3

我只是一个虾纸丫 提交于 2019-12-14 03:39:32
问题 I am using Asp.Net Mvc3 and the unobtrusive jquery validation. I'd like to have my dates validation localized, I mean, jquery is validating my date as being MM/dd/yyyy but I would like it to be dd/MM/yyyy. I'm trying to use the jQuery Globalize plugin (http://github.com/jquery/globalize). I added references to the scripts globalize.js and globalize.culture.pt-BR.js and when my page loads I'm running the follwing script: (function() { $(function() { $.datepicker.setDefaults($.datepicker

validate form fields based on other fields jquery validate

放肆的年华 提交于 2019-12-14 03:12:14
问题 I've got three input fields: NAME, AGE, COUNTRY I want to check if NAME is anything. If NAME contains a value then the two other fields is required. If NAME is empty they can also skip AGE and COUNTRY. Is this possible with jquery validate? My current validation is based on a classname and then I've got the following in my js file: beforeSubmit: function () { return $('#ajaxform').validate().form(); } 回答1: you can use depends , like: ... ageInput: { required: { depends: function(element){

How can I validate a group within another group and maintain separate error messages?

不打扰是莪最后的温柔 提交于 2019-12-14 02:52:59
问题 I'm trying to use the 'require_from_group_update' method with jquery validator and have run into a snag I need help with. I working with multiple forms (24 in total) and each has many, many fields. In some instances, I need to validate groups of questions. As long as the groups are exclusive, this works great, but in some instances, for example, I need to have 5 total answers but at least 3 from the last 4 questions. So that could mean 1 question in the first group is required and 4 from the

jQuery form validate not working correctly [closed]

家住魔仙堡 提交于 2019-12-14 02:26:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . My problem is i want to validate my form inputs trough jquery.validate. this is my script $(document).ready(function () { $('#formreg').validate({ rules: { Username: { required: true, email: true }, Password: { required: true, minlength: 8 }, Password2:{ required:true, minlength:8 }, Name:{ required:true },

form validation for newsletter signup with javascript popup

蓝咒 提交于 2019-12-14 02:26:34
问题 I have the following code on my homepage for people to sign up for a newsletter - the email address is entered into a newsletter_emails table and on clicking GO button a thank you popup appears. Email: <input type="text" name="email" value="" id="email" /> <input type="button" name="submit" onclick="submit_me()" value="GO" /> <script type="text/javascript" charset="utf-8"> function submit_me() { var email_value = $('#email').val(); $.post("ajax_subscribe.php", { email: email_value }, function

Adding validation rule(s) depending on option selected from dropdown menu

狂风中的少年 提交于 2019-12-14 01:52:49
问题 I am using the jquery validate plugin for the first time. I am in a situation where I have a select box that has three options. I need to do two things: Make the select box required. Depending on the option selected, make other text boxes required. So... <select id="selectBox"> <option value selected></option> <option value="1">1</option> <option value="2">2</option> <option Value="3">3</option> </select> Coord 1: <input type="text" name="coord1"><br> Coord 2: <input type="text" name="coord2"

Validating multiple select boxes with the jQuery Validation Plugin

混江龙づ霸主 提交于 2019-12-14 01:27:14
问题 So I've run into a bit of an issue while working with the jQuery Validation Plugin. I have 3 select tags next to each other so a user can enter their birthday. How do I go about having 1 validation message for 3 select tags? I've heard maybe a custom rule can be done? Here's the HTML and I've included a jsfiddle. <form id="commentForm" action="" method="post"> <p> <label for="month">Birthday:</label> <select name="month" class="required select"> <option value="">Month</option> <option>Jan<

Email Validation using JQuery (emails matching) [closed]

大憨熊 提交于 2019-12-13 23:15:48
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am using the following validation on my form, as i have a email address field and confirm email address field i need some validation to make sure these two fields match, i currently have the following which is giving me the error message that it does not match even when it does, anyone know why this could be?

Using custom CSS with jQuery validation? [closed]

烈酒焚心 提交于 2019-12-13 22:54:39
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How can I use a custom CSS class for the error messages? I'd rather not style the standard label.error. I want to use a CSS class I already have. 回答1: There is an option for jQuery Validate called errorClass :

Ensure finish time is greater than start time if start/finish dates are equal using jQuery validate plugin

不问归期 提交于 2019-12-13 22:14:22
问题 I've got 4 fields - start date (text field using jQuery datepicker), start time (dropdown select), finish date (text field using jQuery datepicker) and finish time (dropdown select). <form id="my_form"> <label for="start_date">Start Date</label> <input type="text" id="start_date" name="start_date" /> <label for="start_time">Start Time</label> <select name="start_time" id="start_time"> <option value="09:00" >09:00</option> <option value="09:30" >09:30</option> <option value="10:00" >10:00<