jquery-validate

jQuery Validation on Select List themed with jQuery UI SelectMenu Plugin

雨燕双飞 提交于 2019-12-12 03:38:18
问题 This is a followup to another question; First I needed to get the validation working on a normal select list. (The first part is available here) I have a select menu that has some jQuery Validation logic on it. I am using ASP.NET MVC, so there are some custom attributes - but right now I just want the validation to work, so the attributes are not important. I managed to get that to work (actually, Gajotres solved it, not me.) Now I want to extend it into the jQuery UI selectmenu plug (plugin

jQuery require_from_group if a form field is filled/selected

我的未来我决定 提交于 2019-12-12 03:38:08
问题 I have a page which allows people to input details of up to five Referrals which are non-compulsory. Each group of referral is contained within its own div . When any one of the fields is filled/selected, I need to check that all the other fields and at least one contact number within the same div are filled as well. If no field is filled/selected, the form should pass through successfully. I am stuck at this for the longest as I only managed to use require_from_group for the contact numbers

How to use form submit when using jQuery Unobtrusive Validation?

情到浓时终转凉″ 提交于 2019-12-12 03:34:35
问题 i test the below code but does not work. $("form").data("validator").settings.submitHandler = function (form) { alert('submit'); //form.submit(); return false; }; where i made the mistake any idea. i am getting this error at firbug TypeError: $(...).data(...) is undefined looking for suggestion. thanks 来源: https://stackoverflow.com/questions/36306822/how-to-use-form-submit-when-using-jquery-unobtrusive-validation

Jquery Validation with multiple textboxes with same name and corresponding checkboxes with same name

笑着哭i 提交于 2019-12-12 03:23:21
问题 How can I add Jquery Validation for multiple textboxes with same name, when their corresponding checkboxes are checked Jquery: $("input:[name='abc']").change(function() { var method = $(this).val(); if ($(this).is(':checked')) { $("#" + method).spinner({ 'disabled': false }); console.log(method); $("#" + method).rules("add",{ range: [1, 99], required : true, messages: { range: "Please enter a value between 1 and 99", required: "Please give a value for " + method } }); $("#" + method).val(1);

jQuery form serialize - just returns an empty string

此生再无相见时 提交于 2019-12-12 03:19:51
问题 I am not getting any data from serializing my html form. Here is the form <form method="post" action="#" name='basicForm' id='basicForm'> <input type="text" name="n_username" id="id_username" class="form-control uname" placeholder='Username' value='test_user' data-msg-required='The input field is required.' data-rule-required='true'/> <input type="password" name="n_password" id="id_password" class="form-control pword" placeholder='Password' value='xxxx' data-msg-required='The input field is

jQuery Validate plugin does not work with rules('add') method

半城伤御伤魂 提交于 2019-12-12 03:03:36
问题 I've a problem... I'm working on a joomla custom search module for sobipro, which can search in a specific category, but can't search in its sub-categories. For this reason i need to validate the form and set as "Required" the "sid_list1" select list class. I'm trying to use the JQuery Validate Plugin, but it doesen't work for me. This is how i set him, any idea? <script text= type='text/javascript'> $("#XTspSearchForm132").validate( { rules: { $('.sid_list1').each(function() { $(this).rules(

JQuery validation “remote” method response waiting message

自闭症网瘾萝莉.ら 提交于 2019-12-12 03:01:56
问题 I am using JQuery validation plugin "remote" method for Ajax based validation. But I have to make some third party calls to verify data and it takes approx. 30 seconds. So need to show some message to end user while data is getting processed by Ajax request. Can anyone help to achieve this? 回答1: You can see an example from below that i done: jQuery Validate (Remote Method): $("#myform").validate({ rules: { email: { required: true, email: true, remote: { url: 'your-url-or-path-here.php', cache

Jquery Unobtrusive validation lost after implementing onSubmit event

半腔热情 提交于 2019-12-12 02:59:58
问题 I'm using ASP.NET MVC. My validation works well until I attached an event to the form's onSubmit event. This is how my form looks: @using (Html.BeginForm("Recover", "Auth", FormMethod.Post, new { Id = "RecForm", onSubmit = "return Events.Submit(this,event)" })) { @Html.TextBoxFor(model => model.Email) @Html.ValidationMessageFor(model => model.Email) <input type="submit" value="Recover" /> } The Javascript (works fine, just put it here so you can check if something in this is causing the

jquery validate total percentange of two inputs not greater than 100%

白昼怎懂夜的黑 提交于 2019-12-12 02:57:09
问题 I'm out of idea how to set validation rule to my form. I have two fields for input of numbers which represent percentage and I wanna to set the rule which checks if total or sum of this two field is not greater than 100. So far i added rule that checks if number entered in one of the fields isn't greater than 100 but that's not my final solution. I need it to forbid user for entering in example in both fields 100, or 90 and limit only so the total sum is equal to 100. for example he can input

Not all input fields working with jQuery Validation

做~自己de王妃 提交于 2019-12-12 02:55:37
问题 I am working with jQuery validate and for some reason my rules for the inputs description and down do not work. The only error in the console I get is for my validate file, which is jQuery's, version 1.14.0. Uncaught TypeError: e[d].call is not a function ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js:4 Uncaught TypeError: e[d].call is not a function However, I believe I had this error before I added the rules for the description down. Am I doing this correctly or does