Questions tagged [jquery-validate]

1

votes
2

answer
1.4k

Views

jQuery Validate & Nice Select consistent at all?

Is Nice Select working with jQuery validate ? Because I get a strange bug, I'll try to explain it Without yet having submitted the form, I'm able to select the the value from nice select plugin and it update correctly the (default select dropdown) value and I can submit the form without problem Now...
colapsnux
0

votes
0

answer
4

Views

jQuery Validate error placement and required text placement

I've created a form which I'm using jQuery validate for and I needed to move the error messaging for two of the fields so I found an example on here that showed how to do that and it worked great. Except, now, the 'required' fields are not all working. Here is my form code: Account Number Invoice...
Dana Victoria
1

votes
1

answer
636

Views

Why isn't jQuery validate working on my form?

Can anyone tell me why the fields yourTelephoneNumbers and yourEmailAddress aren't being validated? Basically, I'm trying to design my form so that the user must enter either a phone number or email address. Console Log; Error: Bootstrap tooltips require Tether (http://github.hubspot.com/tether/) bo...
Michael LB
1

votes
2

answer
901

Views

Jquery date rule not working in firefox and IE

I have rendered the normal text with jquery date rule. The date rule working fine in chrome but not working in the Firefox and IE . please see my code block. $('#myform').validate({ rules: { datepick:{ date:'MM/dd/yyyy' } }, messages: { datepick:{ date:'Give MM/dd/yyyy format' } } }); $('#datep...
1

votes
1

answer
1.4k

Views

Jquery validate require from group not working

Having some trouble with this function of the validation plugin: http://jqueryvalidation.org/require_from_group-method Related part of the form: This list of checkboxes is dynamic. It could have 2 entries, or 50 entries, that's why I am using an array in the form. I want the plugin to ensure that on...
Mbrouwer88
1

votes
1

answer
158

Views

How to customize error message using jQuery.validator placeholders?

I'm trying to add custom form validators. And I'm stuck with message customizing issue. Let's say I want to check if field value does not exceeds max allowed value. I know that 'Validation Plugin' has a 'max' validator already - this is just for sample: $.validator.addMethod('max-numeric', function(...
Yurii Bondarenko
1

votes
1

answer
2.5k

Views

Validate Registration Form in Modal And Submit data in database

In my modal I have registration form with fields of name,email,password.While using ajax alone i can add my data.now i tried with bootstrap validator.js to validate the user datas.After that my datas are not stored in database is there any connection between that validator.js and ajax.Here i enclose...
Kavya Shree
1

votes
1

answer
292

Views

JQuery Validation - custom rule

I have a simple form Something Something else Other The bottom radio controls a text input. Initially this is hidden, and I do $('input:radio[name='reason[]']').change( function(){ if ($(this).is(':checked') && $(this).val() == 'Other') { $('#other').css('display', 'block'); } else { $('#other').c...
kate_hudson
1

votes
2

answer
394

Views

Bootstrap Form Validation with jQuery

I've been trying to validate a Form with bootstrap and jQuery. I've looked at the other similar questions on here but none of the solutions were able to fix my problem. My current code is Email: Password: Submit And my Script is this $('form').validate({ rules: { emailAdd: { required: true }, passW...
Kanery
1

votes
1

answer
236

Views

jQuery Validate not firing on submit?

I am running into an issue where the jQuery validate plugin [ https://jqueryvalidation.org/ ] is not firing on my form submit. The script checks out with no syntax errors in Lint. The Google Chrome developer console is not reporting any issues. Yet the form just submits without validating anyt...
eat-sleep-code
1

votes
1

answer
295

Views

How can I require an array to have at least one item by means of client-side validation?

I have a form on which a user can input questions via a textarea. By clicking a button, he can dynamically generate more text fields to input questions into. I'm using Knockout with a client-side viewmodel to which the questions are bound. My simplified view (Razor) is as follows: @Html.ValidationMe...
rumblefx0
1

votes
2

answer
2.7k

Views

Ajax Redirect on new page and after display success message

I am working with ajax and php. I want to display message on another page after user successfully added using Ajax. I have tried so much. It's working when first display 'Success' message on popup and afrer redirect on another page. But i want to first redirect on another page and after display mess...
Neel Thakkar
1

votes
1

answer
2.4k

Views

How to validate Kendo Dropdownlist using jQuery validate

I have normal razor as well as kendo controls in my form, i am facing some problem while trying to validate kendo dropdownlist using jquery validate plugin. The below is my code. @(Html.Kendo().DropDownList() .Name('color') .DataTextField('Text') .DataValueField('Value') .BindTo(new List() { new Sel...
Lijin Durairaj
1

votes
3

answer
34

Views

Form is spanned into 2 seperate divs => not validating properly

My form looks like this: My reduced in-lament code looks like this: FIRST NAME: LAST NAME: I am using JQuery Validate and after adding the library I just scripted this right before the body closes: $('.form-control-static').validate(); The Issue: it doesn't validate any input on the .right-hand-inp...
clusterBuddy
1

votes
1

answer
659

Views

Jquery.Validate error message on top of form with label's name

Is it possible to display the error message above the form like this with jQuery Validation Plugin? I'm doing something like this, but it shows how many fields are invalid. I'm new with jQuery validation and learing so I don't have any idea about this. $('#addQ').validate({ invalidHandler: function(...
Refresh
1

votes
2

answer
41

Views

EqualTo Jquery Valid doesn't work [duplicate]

This question already has an answer here: jQuery Validation Plugin + equalTo Not Working 5 answers I have a problem with validatition jquery, i have two field to use a validatition equalTo, he send a message 'Please enter the same value again.' I made everything correct , but i continue receiving t...
André Alan Alves
1

votes
4

answer
3.8k

Views

jQuery Validation on a .form-group with multiple inputs

Using jQuery Validation plugin, I defined the following for my Bootstrap form: $('.form-with-validation').validate({ errorClass: 'help-block', errorElement: 'span', highlight: function(element) { $(element).closest('.form-group').addClass('has-error'); }, unhighlight: function(element) { $(element)....
Alex
1

votes
1

answer
628

Views

jQuery Validate custom message for contenteditable span or div

I am trying to show a custom error message when a contenteditable span is invalid in the form. My HTML: Submit JS: $(document).ready(function() { var validate_messages = { first_name: 'Please enter your name', something: 'Please enter something' } $('form').validate({ ignore: [], errorLabelContainer...
zer0
1

votes
1

answer
62

Views

Knockout and jQuery Validation Remote: not getting latest value

I have a knockout viewModel and am wiring up jQuery Validation for it. One of the values, code, I want a remote check to ensure it's not already in use. The problem is that in my method for the remote validation, the self.code() call is returning the old value instead of the new one. My Validate c...
jleach
1

votes
1

answer
883

Views

Jquery.validate() with custom checkboxes

I'm having a difficult time getting jQuery.validate() to work with some custom styled checkboxes, and I'm wondering if anyone can see what I may be doing wrong here. The desired result, is when I click SUBMIT, and no checkboxes are selected, the error should appear in the appropriate label. Unfortu...
Murphy1976
1

votes
1

answer
222

Views

Jquery validate not working properly; show error message on entering the value as well

I have written the code below but even if I enter the fields it shows the error message, also how can I stop the button click if there is another method assigned if it shows error messages. $('#reg_form').validate({ rules:{ FirstName:{ required:true }, Email:{ required:true, email:true }, ConfirmEma...
katty
1

votes
2

answer
32

Views

Validate a button based on checkboxes

I am using the JQuery Validate library and I have a button that when clicked, opens a list of checkboxes that pops up beside the button. What I am trying to do is if none of the checkboxes are checked when I click submit, place the validation error on the button, so that the .error class is applied...
Mark Highfield
1

votes
1

answer
792

Views

jQuery Validation, scroll to error doesn't work correctly

so i have a 3 stage form which validates at each step, and again on submission. Im having some problems and i think it may possibly be due to the structure of my JS, but I can't be sure. For some reason it only scrolls to the first error once, once that error is cleared when someone fills in the fi...
Jay
1

votes
1

answer
3.6k

Views

How to use jQuery Validate plugin for bootstrap-select? [duplicate]

This question already has an answer here: Jquery bootstrap select2 plugin issue with validate plugin 1 answer I am using jQuery Validate plugin ( jqueryvalidation.org ) and trying to validate dropdown. The problem is that my dropdown use bootstrap-select plugin and that means library converts 'norm...
JohnWayne
1

votes
1

answer
853

Views

jquery validate - Possible to change submitted field value?

I have a custom method $.validator.addMethod('lettersandspaces', function(value, element) { var value = this.elementValue(element).replace(/\s+/g, ' ').trim(); return this.optional(element) || /^[a-zA-Z][a-zA-Z\s]*$/i.test(value); }, 'Your name may only contain letters'); Here I am trimming whitespa...
user4584963
1

votes
1

answer
248

Views

jQuery Validate does wrong thing with type=“email” and multiple

We are updating our forms to use the correct html 5 input types. Our entry field has the following: We are also using jQuery Validate, version v1.15.1 because we need to support older browsers, and have a custom plugin for handling multiple email addresses. The rules setup are as follows AlternateE...
Chad Yost
1

votes
2

answer
284

Views

Force throw jquery validator error

I am using the jQuery Validate plugin for a ajax form. To validate each field I have used data-rule-required='true'. Now I have four fields (read as 4 credit card fields). Now for all those fields separate am getting required error. I want to combine their values and send throw a single error atta...
Alice
1

votes
3

answer
611

Views

Jquery validate click submit button twice ASP.Net core MVC project

I seem to cannot find a solution for this issue. I have searched and none of the approach persons took seem to apply to my situation. $(document).on('submit', '#createDriverForm', function (e) { e.preventDefault(); $('#createDriverForm').validate({ ignore: null, rules: { driversLicenceCountryId: { r...
1

votes
1

answer
289

Views

In form validate's submithandler ajax getting Uncaught TypeError: form.serialize is not a function

Getting this error in console Uncaught TypeError: form.serialize is not a function . How Can I fix this error in form validate submithandler's ajax ? $('#form').validate({ errorClass: 'fieldError', onkeyup: false, onblur: false, errorElement:'label', submitHandler: function(form) { $.ajax(...
Haroon
1

votes
2

answer
40

Views

JQuery Validation not posting data to backend

I have something weird going on that I am trying to work out. I have a simple submitHandle that passes one bit of data to my PHP file submitHandler: function (form) { $.ajax({ type: 'POST', url: 'form-process.php', data: { 'customer': $('input[name='customer']:checked').val() } }).done(function (re...
kate_hudson
1

votes
1

answer
470

Views

jQuery validation method for group of check boxes with different names

I have a group of checkboxes that due to the integration with another platform must have separate names although they are all related. Type of Insurance* Auto Home Home Condo, Co-op,Renters Generally you could use Field[] and validate that within the jQuery validation rules and set it to required. I...
Orlando P.
1

votes
1

answer
31

Views

Pass data to remote in jquery validate

How can I pass additional data to server with remote request in jquery validate. I tried doing something like this, and it's not resulting as expected. personal_email: { email: true, remote: { param: { url: app.baseurl('user/check_personal_email'), type: 'POST', data: { 'userID': $('#id').val() } }...
Azima
1

votes
1

answer
465

Views

Custom Validation in jQuery Unobtrusive Validation Without Field Name

Is it possible, using jQuery unobtrusive validation, to specify a custom validation function that is not bound to a specific field? I mean, a validation function that is triggered when the form is validated, but not targeted at a specific form field. This is in the context of ASP.NET Core validation...
Ricardo Peres
1

votes
1

answer
41

Views

regex jquery validations

There is a field for 'experience' where users can submit the value with space but not more than two spaces between each word. If they type then it should display an error message. Below are my code and its working in another way. It checks the user's input and if there are no more than two space the...
user7152572
1

votes
1

answer
2.2k

Views

Temporarily disable a rule using jQuery Validate

My form has several rather complex validation rules and it became necessary for me to temporarily disable a given rule only to enable it later. It seemed pointless having to remove it and then add it again later so I needed a facility to disable and enable validation rules.
Rob Forrest
1

votes
2

answer
3.3k

Views

jQuery Validation plugin error message placement for radio button

Please someone help me, I really stuck on this for the whole day. I have a php form (multiple page) with different types of input(radio, checkbox, etc). what I need is : If user didn't fill required fields and pressed the continue button, he should receive an error message BESIDE or ABOVE that fiel...
mOna
0

votes
0

answer
3

Views

Add recaptcha v2 check box 'is ticked' validation to a contact form using bootstrap4 form validation

I have a contact form on my HTML5 webpage which is using the latest version of bootstrap (v4.3) for the form layout and this includes form field validation. When I click the 'submit' button on the contact form, validation takes place on the Name, Email and Message fields to make sure that they conta...
Mark Smith
0

votes
0

answer
2

Views

Custom validation failing with “Cannot read property 'call' of undefined” MVC jquery

I can't for the life of me figure out the problem with this script. I'm doing a custom validation as in this post https://www.codeproject.com/Tips/780992/Asp-Net-MVC-Custom-Compare-Data-annotation-with-Cl The only thing I changes was some date format handling. See my customcompare.js here: $.validat...
Evan Barke
1

votes
2

answer
34

Views

Sending the form .validate () [duplicate]

This question already has an answer here: Validating sections of a form 3 answers jQuery using .on and .validate must submit form twice to validate 5 answers There is a form in modal, on the site of the Click on 'ОСТАВИТЬ ЗАЯВКУ' The modal is implemented as follows. var modal = { sel...
Skip Tyler
1

votes
1

answer
129

Views

Show message to jquery validation with Ajax.BeginForm Asp.Net MVC

I have tested jquery validate with Ajax.BeginForm from asp.net mvc and although the form validate, the error message is not displayed if the form is not valid. FORM CODE: @using (Ajax.BeginForm('Save', 'Student', null, new AjaxOptions { HttpMethod = 'POST', OnSuccess = 'StudentSucess', OnFailure = '...
Leomar de Souza

View additional questions