Questions tagged [jquery-validate]

1

votes
1

answer
1.7k

Views

JQuery Validation: errorPlacement doesn't get called

I use the jquery validation plugin. However, the errorPlacement function won't be executed. No console logging happens if validation errors occur. What to do? I use jquery 1.10.3, I tried 1.9.0 as well. $('#rateform').validate({ debug: true, rules: { stars: { required: true, min: 1 }, errorPlacement...
AndiPower
1

votes
1

answer
2.6k

Views

jQuery validate value rule

I am trying to validate one input. So I wanna to get this kind of rule - if field value is equal to 'xxx' (text) then field is valid. I tried this, but it seems to work only if you want two inputs to be the same. $('#contact-form').validate({ rules: { capcode: { equalTo: 'xxx' } } });​
iKaspars
1

votes
2

answer
835

Views

jQuery Validation Plugin: password field not being validated

I'm using JQuery Validation Plugin in a jQuery Mobile project. I've a simple login form where I need to ensure that both user name and password fields are not empty. Here´s the HTML: And here's the code: $(document).on('pageinit', function(){ $('#my_form').validate({ submitHandler: function...
Mister Smith
1

votes
0

answer
411

Views

jQuery Validation: Dynamically added field gets validation but doesn't work [duplicate]

This question already has an answer here: jQuery Validate array input element which is created dynamically 2 answers Jquery Validation for Dynamically Created Fields 1 answer validating multiple textbox having same name with jquery validator validates only first input 4 answers jquery validator -...
gene b.
1

votes
1

answer
145

Views

jQuery Validation: How can I manually trigger error inside rule?

I have these codes: rules: { shop_name: { minlength: 4, remote: { type: 'POST', url: window.location.origin + '/api/shop/', success: function (data) { console.log(typeof data); console.log(data); } }, required: true } } The remote rule expect the returned value to be echo 'true' or echo 'false'. How...
notalentgeek
0

votes
2

answer
4.6k

Views

jQuery Validate: Remove element AFTER validation BEFORE submit?

I have a SVG map of a city that when clicked, creates hidden elements in a div in my form. I'm using the jQuery Validation Plugin to validate my form. In order to make sure that the user has clicked on an area of the map, I thought to create a dummy hidden element inside where the normal hidden elem...
neezer
1

votes
1

answer
113

Views

Jquery validation place all errors in single div with li element [duplicate]

This question already has an answer here: Pass jQuery validate error messages to a single box (div) 1 answer I want to display all the validation errors under single div with li element. Following is my code $('#login_form').validate({ showErrors: function (errorMap, errorList) { $('#error_list').h...
Akshay Deshmukh
0

votes
1

answer
204

Views

attaching jquery validation to replacement element

I have an aspnet mvc form with a dropdown list in, that I am replacing with a jquery combobox. the original dropdownlist has a client validation set against it - using the unobtrusive lib along with the standard jquery validate - , and I would like this validation attached to the combobox instead. a...
nat
1

votes
0

answer
150

Views

Uncaught TypeError: Cannot read property 'settings' of undefined at HTMLInputElement.delegate

I am new to Asp.net Core MVC. I have a view with validations from which I call a partial view using Jquery and ajax. The partial view displays correctly but the vaidation is not working in the partial view. Its throws up the error 'Uncaught TypeError: Cannot read property 'settings' of undefined at...
Kicha
1

votes
0

answer
36

Views

cannot get a response from NodeJS server using remote method in jQuery

I'm working on a signup page. I want to validate the input email using jQuery Validation. The server is written in NodeJS (with ExpressJS). As I tab out of the email input, it should send me a message that the email has already existed. Instead, it gives me an error of GET http://0.0.0.0:3000/checke...
Kien Nguyen
1

votes
1

answer
64

Views

jQuery Validate Plugin: German Umlauts not working

I am using the jQuery Validation Plugin () and I also found already an answer here on StackOverflow (jQuery validate plugin: accept only German letters) but the provided solution is still not working for me. I have umlauts (special characters) like Ö,Ü,ä,ß in my language and I use the following...
Christoph C.
1

votes
1

answer
55

Views

jQuery validation plugin doesn't validate my form

My main goal is check the value that user enter in input, exists in database. So my validation looks like: $('#addForm').validate({ rules: { SendingName: { required: true, remote: { url: '@Url.Action(MVC.Product.CheckUniqueSendingName())', type: 'get', data: { subscriptionType: function () { ret...
mishamusha
1

votes
0

answer
55

Views

Jquery validate rules with custom function not working

I have table with dynamic rows create using jquery. I try to add required field validation for each row using my custom defined function but not working as expected. please have a look below is screenshot of my dynamic table my validation should work as following ways: if there is only row present...
Code Embassy
1

votes
1

answer
87

Views

jQuery validation for multiple input fileds

I have 4 input fields as below screen. Code is below. I'm using this with jQuery Step Plugin. I want to validate this with following conditions. All fields are required If filled LicenceNumber1 and LicenceNumber1Date then no need LicenceNumber2 and LicenceNumber2Date fields. Same as if filled Licenc...
Sumith Harshan
1

votes
1

answer
182

Views

How do I resolve jquery-validate + bootstrap has-error conflict

I'm sorry if this is an easy fix, and the wall of text but I've scoured the net and this site and found many solutions, none address my problem: I have a server-side validation to ensure no company exists in the DB with the same name, the request fires, and returns with the expected result of true/f...
Captain Comedy
1

votes
0

answer
33

Views

jQuery validator custom method undefined *sometimes*

I've occasionally been getting a weird error reported in Sentry that one of our custom jQuery validator methods is undefined. However, this should be impossible - we're using webpack to bundle our scripts, and the custom methods are bundled in the same bundle as both jQuery and validator. This is a...
Mike Willis
0

votes
1

answer
98

Views

jQuery Validation remote with invalid variable name: How to fix?

I'm using remote validation with jQuery Validation. I'm trying to call my server side code in MVC but the problem is that my variable is in a nested class: public class Customer { public State HouseState {get;set;} } public class State { public string Name {get;set;} } In my *.cshtml I have this: @H...
Vitor Canova
1

votes
2

answer
223

Views

webpack symfony encore jquery third party plugins

i am having problem with implementing jquery 3rd party plugins in symfony webpack encore. so far i have several .js files with varous logic, and also some scripts inside twig files that execute some of js. this is app.js : var $ = require('jquery'); global.$ = global.jQuery = global.jquery = $; requ...
Krešimir Fijačko
1

votes
0

answer
61

Views

Validation error message not showing up on first submit [duplicate]

This question already has an answer here: Why did my form start requiring a double click to submit after I added the jquery validation plug in? How do I change it? 1 answer jQuery Validation need to execute same validation twice 1 answer jQuery using .on and .validate must submit form twice to val...
sbattou
1

votes
1

answer
373

Views

How to jquery validate dynamically generated hidden textarea

I am trying to validate multiple array of textarea which are added dynamically and are hidden as well. So what I am doing exactly is, I am using contenteditable div and whenever user inputs it sets the value of textarea which is hidden. So I am using validation for the textarea I researched and foun...
topper1309
1

votes
4

answer
1.7k

Views

JQuery toggle Q&A: individual Q&As don't operate correctly unless you click on Open All/Close All first

I have a Q&A list with 'Open All/Close All' at the top with individual open and close image buttons that toggle when clicked. That works fine. Then follow individual Q&As, and each has its own open and close image. If you click on 'Open All/Close All' first, as soon as the page loads, and then clic...
1

votes
1

answer
1.5k

Views

jquery validation rules and a weird IE7 error

I have the following validation: phone1: { required: { depends: '#pri_noPhone:not(:checked)' }, number: true, minlength:3, }, If a checkbox is checked (yes, contact me via phone) then go validate the phone1, phone2 and phone3. In FF and Firebug, there are no errors. However, IE7 throws an error sayi...
CFNinja
1

votes
2

answer
1.7k

Views

jQuery Validator custom method

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 t...
OneSHOT
1

votes
2

answer
6.8k

Views

Jquery Validation - Value can't be greater than

I'm trying to do some validation on 2 numerical fields and not done much JQuery validation this year. -Product A comes with Product B. -You can have unlimited amount of Product A -But Product B can only have the same or less than Product A For example: If Product A qty is 5 then product B can be 1 t...
Peter
1

votes
1

answer
1.3k

Views

jQuery Validation on field(s) with a prefix in the name property

I'm trying to add the jQuery Validation plugin to some websites and I'm running into a bit of an issue in that the fields that it's supposed to validate have a prefix on the name property, such as 'Customer.FirstName'. Since you have to pass a JSON object to the validate function for the rules, it d...
Gup3rSuR4c
1

votes
1

answer
444

Views

JQuery Validator Plugin

I have managed to implement the validator on a form, and is working fine for all my needs apart from a crucial last one. Does anyone know how I would go about (or whether it's even possible) to extend or create a validation message that is purely a warning but still allows the form to be submitted (...
Monkeeman69
1

votes
1

answer
78

Views

Validator plugin firing with links and on submit

I have a web form which is split up into several HTML pages. I am using the validation plug-in to check fields on submit and this is working great. The spec says that users should be able to navigate through the form, both linearly (just using the submit buttons to go from page to page) and also to...
Phil Molloy
1

votes
2

answer
1k

Views

JQuery Validation Plugin: Ensure Form Field is not a specific Value

i am using the Jquery validation plugin, sourced from here. It is function well for required fields, email etc, however I would like to set up some specific validation rules for certain form fields. For example, I have a select form field which contains the following options... --- Please Select ---...
namtax
1

votes
1

answer
162

Views

Using jQuery how do I find the first ELEMENTTYPE that's a parent to the element selected?

I have a particular element (input box) that's deeply nested in some table stuff (td,tr, table). How can I select the 'fieldset' that encompasses it all?
Shamoon
1

votes
2

answer
689

Views

jQuery ajax call not working in FF and safari works in IE

I made a little module to use a jquery/ajax script on my website. For that I used examples which are on the site and others. The script is working in IE (for a change it works there) but I cannot get it working in FF or safari. Tried a lot of things but somehow it never executes the updatecounter f...
Erald
1

votes
2

answer
1.8k

Views

jQuery Validation - Highlighting Radio Labels

I'm trying to use jQuery validation to highlight the labels for my radio buttons only, and not the labels for my other inputs. I have a label for my radio button set called 'type'. I can't seem to get it to work! $(document).ready(function(){ $('#healthForm').validate({ highlight: function(element...
Michael
1

votes
1

answer
1.5k

Views

Combining the jquery Calendar picker with the jquery validation and getting them to play nice?

I'm just starting to get into jquery/javascript programming so this may be a beginner question but I sure can't seem to find anything about it. I have a text field on a form. I've used the JQuery UI Calendar picker to make data entry better. I've also added jquery validation to ensure that if the us...
Matthew Bonig
1

votes
3

answer
2.9k

Views

jquery newbie: combine validate with hidding submit button

I'm new a jQuery. I have gotten validate to work with my form (MVC 1.0 / C#) with this: if (document.forms.length > 0) { document.forms[0].id = 'PageForm'; document.forms[0].name = 'PageForm'; } $(document).ready(function() { $('#PageForm').validate({ rules: { SigP: { required: true } }, messages:...
Jeffb
1

votes
1

answer
1.2k

Views

jQuery - Change jqueryvalidate to add class to parent li

I'm currently trying to edit GeekTantra's jQuery Validate plugin to make it apply a class to the parent list item containing the input field if an error message is displayed. Here is the code with my addition of jQuery(id).addClass(redhighlight); I'm fairly new to jQuery so I'm probably making a blo...
1

votes
3

answer
1.7k

Views

Styling jQuery validation

When I have this, the div, which just has text in it, uses all the horizontal width it can, so there's trailing width after the text, which I can tell from the background color. errorElement: 'div', errorPlacement: function(error, element) { error.insertBefore('#zzz'); When I use this, the width is...
Steve
1

votes
1

answer
920

Views

jQuery custom validation for a selected radio selection

This is my requirement: I have a bunch of radio box selections (types of workflows). If one of the radios are selected(i.e one particular type of workflow selected), I want to run a custom validation on that. This is what i tried, but it's not behaving well. Any help? jQuery part: $(document).ready(...
Kaushik Gopal
1

votes
1

answer
911

Views

jQuery Validate Element

jQuery Validate plugin passes element value to inline validate functions. I'm trying to get element's id and an error telling that 'element.attr is not a function' : function someFunction(element) { var elementId = element.attr('id'); } rules: { someFiled: { required: someFunction } }
SiberianGuy
1

votes
1

answer
129

Views

jQuery Validate Plugin get more control

How can I get more control or error placement? I have similar error messages for two elements and I want only one of them to be displayed.
SiberianGuy
1

votes
1

answer
2.3k

Views

Jquery Validation Watermark

I am using jQuery validation plugin and Watermark plugin. The problem I am facing is when i applied a watermark to any input field for which validation is also applied then validations are failing For Example: and I applied a watermark for this field in document ready function: $('#myinput ').Water...
1

votes
3

answer
3.1k

Views

jquery mouseover/mouseout

In the following code once the mouse out is done the mouse over again does not work ,what is the work around for this /* div { background:#def3ca; margin:3px; width:80px; display:none; float:left; text-align:center; }*/ Mouse over me $(document).ready(function() { $('#playControls').mouseover(funct...
Hulk

View additional questions