jquery-validate

jQuery Validate plugin : Only one field required out of multiple [closed]

点点圈 提交于 2019-12-13 11:11:29
问题 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 . Wrt this question on stackoverflow , if the telephone and mobile fields are empty then it gives an error message but after that when either of the two is filled and the form is submittted again then too the error

How can I set data-* attributes on the button when the AJAX requests complete?

拈花ヽ惹草 提交于 2019-12-13 11:06:55
问题 This is a follow up question for the one asked before https://stackoverflow.com/a/33550107/4662074 And to be honest I just need a hint here. I have the jquery validate submit handler and it calls the ajax query. This query returns some data and I want this data to be used when user clicks a button on the webpage. Now, the user suggests that I cannot use the click hangler attached to the button inside the submit handler of my validate. But how can I pass the data there? I have my button in

Jquery Validation for Two Dropdown Boxes [duplicate]

独自空忆成欢 提交于 2019-12-13 10:06:00
问题 This question already has answers here : jQuery Validate Plugin - How to create a simple custom rule? (7 answers) Closed 4 years ago . I have Two dropdown boxes, if i select 4 from first select box, the value of the second dropdown value must be less than the first dropdown. if it fails show a custom error message, like that. <select name="t_dropdown" id="t_dropdown" class="form-control required"> <option value="">Select Value</option> <option value="1">1</option> <option value="2">2</option>

jQuery validation conflicts with Ajax form submission [duplicate]

99封情书 提交于 2019-12-13 09:55:28
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: jQuery validation: some of the required field not filled but the form can still be submitted I used jquery validation (http://bassistance.de/jquery-plugins/jquery-plugin-validation/) for form validation: HTML: <form id="formID" action="/processForm" method="post"> ... <input type="submit" value="Submit" /> </form> jQuery: $("#formID").validate({ onkeyup:false, rules: { ... }, messages: { ... } }); // Submit the

jquery validation position error label

喜欢而已 提交于 2019-12-13 09:36:05
问题 and this also not worked for me an error occurd when I tried this: error.insertBefore(element) error.css('float','left') or: error.attr('style','float:left') only I can add these properties like this: $(error).someproperty This is my code as I can't copy paste because I work on TFS and copy/paste is not allowed. Problem is that with this code I can not float left error message. I want that error should appear on left and below the textbox. One thing more, I was just testing and I put float

Required Field Validation only when field is visible in asp.net mvc

萝らか妹 提交于 2019-12-13 09:34:21
问题 I have a checkbox where you can hide/show a datepicker field. But when the datepicker field is hidden there has to be no validation. This is the checkbox: @Html.CheckBox("showEindDatum", (Request.Form["showEindDatum"] ?? string.Empty).Contains("true")) And this is the datepicker: @FormGroupHelper.CreateFormGroup(Html, m => m.EindDatum, Html.Kendo().DatePickerFor(m => m.EindDatum).Min(Model.EindDatum.HasValue ? Model.EindDatum.Value : DateTime.Today).Format("dd-MM-yyyy").ParseFormats(new

Send image with ajax , using jquery validator on submitHandler

那年仲夏 提交于 2019-12-13 09:30:45
问题 I trying to send two images with ajax (inside submitHandler) after using jquery validator plugin and i don't know hoy i cant take and send this image by ajax. My code here: var submitHandler = function(form) { var formData = form[0]; var formData = new FormData(formData); $.ajax({ url: 'function/savePreInscripcion.php', type: 'POST', data: formData, mimeType: "multipart/form-data", contentType: false, cache: false, processData: false, success: function(data){ alert(data); } }); }; but this

Why does jQuery Validate plugin do validation without calling validate()?

空扰寡人 提交于 2019-12-13 09:16:54
问题 I have just give option to the validate (errorElement, ...), and I set the rules, without calling validate method, or associating it with any event, but jQuery validates automatically, how to control when it validates? 回答1: You're going to need to provide a lot more detail about what you're trying to do, but I can answer your question as you've written it so far. Title : why does jquery validate without calling validate? .validate() is called once to initialize the plugin on the form. It is

validate on field blur using jquery validate plugin [duplicate]

旧街凉风 提交于 2019-12-13 08:47:07
问题 This question already has an answer here : jquery validate plugin not working on blur of the fields (1 answer) Closed 4 years ago . I need jquery validate plugin to validate all my fields on blur of the fields. Currently its validating only on submit of the form. How can I achieve this? HTML <input class=" required minlength " type="text" id="firstName" name="firstName" minlength="3" maxlength="40" /> Jquery $(document).ready(function() { form = $('#submitForm'); if (form.length) { form

jQuery validation regex for white space getting a “Uncaught TypeError: Cannot call method 'call' of undefined error”

梦想的初衷 提交于 2019-12-13 08:39:42
问题 Here is my jquery code as per a previous stackoverflow question $('#productId').validate({ rules: { product: { required: true, term: {regex: /^$|\s/} } }, messages: { product: { required: "A text is much", term: "Please avoid spaces" }, }, showErrors: function (errorMap, errorList) { $.each(this.successList, function (index, value) { $('#'+value.id+'').popover('destroy'); }); $.each(errorList, function (index, value) { $('#'+value.element.id+'').attr('data-content',value.message, 'title',