[jQuery] Jquery Validation Email issue (validate)
It seems to be normal behaviour, but when using jquery's validate plugin my client was not happy the a single domain suffix character was enough to clear the valid email error. ie; tes...@googlemail.c would validate. To ensure that at least 2 characters had to be entered into the field to validate I changed the email function to the following; email: function(value, element) { // contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/ return this.optional(element) || /^((([a-z]|\d|[!#\$%'\*\+\-\/=\? \^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\ $%'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]) +)*)|((\x22)\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b \x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900- \uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF \uF900-\uFDCF\uFDF0-\uFFEF]*(((\x20|\x09)*(\x0d\x0a))?(\x20| \x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0- \uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]| \d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d| [\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]{2}|[\u00A0- \uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF \uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0- \uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/ i.test(value); }, I'm no expert at regex but this worked for me. Thanks, Matt
[jQuery] Jquery validation remote problem
Hi, I'm using Jquery.validation to remotly test if an e-mail is already in use, it works fine, but... if i do a remote check, it returns the correct response e.g. some...@abc.com already in use but when i click on the field, and then somewere else the message changes to filename.php already in use. Try is on http://www.red187.nl/milk/ This only happens when i set the return vale to 'false' in th eremote file, when i return a message there is no problem... Can someone help me please?
[jQuery] Jquery Validation on Dropdown list Question
How can I validate this as one hidden field.I have 3 dropbdown list month, day, year and I do not want to validate each separate on so I would like to combine the strings together and validate the hidden field. Pleas and thank you for your help. !-- DOB -- fieldset id=section-dob class=group legendspanBirth date/span/legend !-- Month -- div label for=dob_monthMonth/label select name=month value= id=month onchange=document.getElementById('birthdate').value = document.getElementById('month').value + '/' + document.getElementById('day').value + '/' + document.getElementById('year').value; option selected=selected value= Month/option ?php for($i=1;$i=12;$i++) { echo option . $i . /option; } ? /select /div !-- Day -- div label for=dob_dayDay/label select name=day value= id=day onchange= document.getElementById('birthdate').value = document.getElementById('month').value + '/' + document.getElementById('day').value + '/' + document.getElementById('year').value; option selected=selected value=Day/option ?php for($i=1;$i=31;$i++) { echo option . $i . /option; } ? /select /div !-- Year -- div label for=dob_yearYear/label select name=year value= id=year onchange= document.getElementById('birthdate').value = document.getElementById('month').value + '/' + document.getElementById('day').value + '/' + document.getElementById('year').value; option selected=selected value=Year/option ?php for($i=2005;$i=2008;$i++) { echo option . $i . /option; } ? /select
[jQuery] jQuery Validation Plugin messages by field rule.
Hi! Im quite newbie with jquery but so far i think it realy rocks. Anyways im now trying to use Validation plugin but have one problem to solve to get in job done. My form has natrually many fields, each field can have many rules, even custom rules. Trouble is that i cant find a way to overwrite default messages by fields rule. For example i wanna different error messages for first_field required message and first_field minlength message. And those messages would need to be different than second_field with same rules but different messages. (Dont know if nested messages is right word for what i want) Code what i have. jQuery.validator.setDefaults({ debug: true, success: valid, }); jQuery.validator.addMethod(customRule,function (value) { var i; for (i=0; i arr.length; i++) { if (arr[i].value == value ) { return true; } } return false; }, CustomRule message.); $(document).ready( function(){ var validator = $(#form).validate({ rules: { inputfield_1: { required: true }, inputfield_2: { required: true, maxlength: 5, customRule: true } }, messages: { inputfield_1: inputfield1 message , inputfield_2: { // THIS IS WHAT I WOULD LIKE TO HAVE messages: { required:inputfield 2 required message, maxlength:inputfield 2 maxlength message, customRule: maybe overwrite custom message here } } } }); Hope you understand my problem... I would be realy glad if someone could. Thanks for advance!
Re: [jQuery] jQuery Validation Plugin messages by field rule.
Hello Antti and all, You just don't need to nest messages, they should be overwritten: inputfield_2: { // THIS IS WHAT I WOULD LIKE TO HAVE required:inputfield 2 required message, maxlength:inputfield 2 maxlength message, customRule: maybe overwrite custom message here } -- With best regards from Ukraine, Andre Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org Yahoo! messenger: andre.polykanine; ICQ: 191749952 Twitter: m_elensule - Original message - From: Antti antti.mak...@mindworks.fi To: jQuery (English) jquery-en@googlegroups.com Date: Saturday, December 19, 2009, 12:09:32 PM Subject: [jQuery] jQuery Validation Plugin messages by field rule. Hi! Im quite newbie with jquery but so far i think it realy rocks. Anyways im now trying to use Validation plugin but have one problem to solve to get in job done. My form has natrually many fields, each field can have many rules, even custom rules. Trouble is that i cant find a way to overwrite default messages by fields rule. For example i wanna different error messages for first_field required message and first_field minlength message. And those messages would need to be different than second_field with same rules but different messages. (Dont know if nested messages is right word for what i want) Code what i have. jQuery.validator.setDefaults({ debug: true, success: valid, }); jQuery.validator.addMethod(customRule,function (value) { var i; for (i=0; i arr.length; i++) { if (arr[i].value == value ) { return true; } } return false; }, CustomRule message.); $(document).ready( function(){ var validator = $(#form).validate({ rules: { inputfield_1: { required: true }, inputfield_2: { required: true, maxlength: 5, customRule: true } }, messages: { inputfield_1: inputfield1 message , inputfield_2: { // THIS IS WHAT I WOULD LIKE TO HAVE messages: { required:inputfield 2 required message, maxlength:inputfield 2 maxlength message, customRule: maybe overwrite custom message here } } } }); Hope you understand my problem... I would be realy glad if someone could. Thanks for advance!
[jQuery] jQuery validation error: 'settings' is null or not an object
Hi all, I'm using jQuery validation plugin and everything works fine in Firefox. But in IE (78), when I try to validate my form, I get the error - ['settings' is null or not an object]. I'm using simple rules like this: $(#FormID).validate({ rules: { FirstNameText:required }, messages:{ FirstNameText: Please enter first name } }); I searched for similar posts and found this: http://groups.google.com/group/jquery-en/browse_thread/thread/831feb27923dc32c . However, a convincing answer is not given. Can some one tell me why this error is coming?
Re: [jQuery] jQuery validation error: 'settings' is null or not an object
It's pretty hard to tell what could possibly be wrong from just that code snippet. If you can post a link to a test page that demonstrates the problem, it will be much easier for someone to help. -Mike On Tue, Dec 8, 2009 at 10:17 AM, NovoGeek kris.techg...@gmail.com wrote: Hi all, I'm using jQuery validation plugin and everything works fine in Firefox. But in IE (78), when I try to validate my form, I get the error - ['settings' is null or not an object]. I'm using simple rules like this: $(#FormID).validate({ rules: { FirstNameText:required }, messages:{ FirstNameText: Please enter first name } }); I searched for similar posts and found this: http://groups.google.com/group/jquery-en/browse_thread/thread/831feb27923dc32c . However, a convincing answer is not given. Can some one tell me why this error is coming?
[jQuery] JQuery validation plugin - custom validation for group of html elements
I have a set of combo boxes on a HTML form which act as a Date control: div id=datecheck select id=datecheck_y name=datecheck_y option value=20092009/option option value=20082008/option option value=/option /select select id=datecheck_m name=datecheck_m option value=1Jab/option option value=2Feb/option option value=/option /select select id=datecheck_d name=datecheck_d option value=11/option option value=3131/option option value=/option /select /div No I want to validate whether the user has left any value (year/month/day) as blank, or if the values form a valid date (example invalid date: 2009(datecheck_y),Feb(datecheck_m),31(datecheck_d) For this I wrote two custom rules in JQuery, here is my approach: I have two custom rules (REQUIRED_DATE, VALID_DATE): $().ready(function() { $.validator.addMethod(REQUIRED_DATE, function(value, element) { CheckBlankDate(element); }, Date cannot be left blank); $.validator.addMethod(VALID_DATE, function(value, element) { return this.optional(element) || CheckDate(element); }, Date should be valid); $(#form1).validate({ rules: { datecheck: { REQUIRED_DATE: true,VALID_DATE: true } }, messages: { datecheck: { REQUIRED_DATE: Date is required, VALID_DATE: Date should be valid } } }); }); Here are the CheckDate, CheckDateBlank JavaScript functions for reference: function ValidateDate(y, mo, d, h, mi, s) { var date = new Date(y, mo - 1, d, h, mi, s, 0); var ny = date.getFullYear(); var nmo = date.getMonth() + 1; var nd = date.getDate(); var nh = date.getHours(); var nmi = date.getMinutes(); var ns = date.getSeconds(); var flag = (ny == y nmo == mo nd == d nh == h nmi == mi ns == s); return (flag); } function CheckDate(dateElement) { var y, mo, d, h, mi, s; y = document.getElementById(dateElement.id + '_y').value; mo = document.getElementById(dateElement.id + '_m').value; d = document.getElementById(dateElement.id + '_d').value; h = document.getElementById(dateElement.id + '_h').value; mi = document.getElementById(dateElement.id + '_min').value; s = 0; return ValidateDate(y, mo, d, h, mi, s); } function CheckBlankDate(dateElement) { var y, mo, d, h, mi, s; y = document.getElementById(dateElement.id + '_y').value; mo = document.getElementById(dateElement.id + '_m').value; d = document.getElementById(dateElement.id + '_d').value; h = document.getElementById(dateElement.id + '_h').value; mi = document.getElementById(dateElement.id + '_min').value; s = 0; if(y== || mo == || d==) { return false; } return true; } This approach does not work, as I believe JQuery cannot find any input element with name datecheck. Is there any other approach that we can follow? -- View this message in context: http://old.nabble.com/JQuery-validation-plugin---custom-validation-for-group-of-html-elements-tp26421224s27240p26421224.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] JQuery validation plugin - custom validation for group of html elements
I have a set of combo boxes on a HTML form which act as a Date control: div id=datecheck select id=datecheck_y name=datecheck_y option value=20092009/option option value=20082008/option option value=/option /select select id=datecheck_m name=datecheck_m option value=1Jab/option option value=2Feb/option option value=/option /select select id=datecheck_d name=datecheck_d option value=11/option option value=3131/option option value=/option /select /div No I want to validate whether the user has left any value (year/month/ day) as blank, or if the values form a valid date (example invalid date: 2009(datecheck_y),Feb(datecheck_m),31(datecheck_d) For this I wrote two custom rules in JQuery, here is my approach: I have two custom rules (REQUIRED_DATE, VALID_DATE): $().ready(function() { $.validator.addMethod(REQUIRED_DATE, function(value, element) { CheckBlankDate(element); }, Date cannot be left blank); $.validator.addMethod(VALID_DATE, function(value, element) { return this.optional(element) || CheckDate(element); }, Date should be valid); $(#form1).validate({ rules: { datecheck: { REQUIRED_DATE: true,VALID_DATE: true } }, messages: { datecheck: { REQUIRED_DATE: Date is required, VALID_DATE: Date should be valid } } }); }); Here are the CheckDate, CheckDateBlank JavaScript functions for reference: function ValidateDate(y, mo, d, h, mi, s) { var date = new Date(y, mo - 1, d, h, mi, s, 0); var ny = date.getFullYear(); var nmo = date.getMonth() + 1; var nd = date.getDate(); var nh = date.getHours(); var nmi = date.getMinutes(); var ns = date.getSeconds(); var flag = (ny == y nmo == mo nd == d nh == h nmi == mi ns == s); return (flag); } function CheckDate(dateElement) { var y, mo, d, h, mi, s; y = document.getElementById(dateElement.id + '_y').value; mo = document.getElementById(dateElement.id + '_m').value; d = document.getElementById(dateElement.id + '_d').value; h = document.getElementById(dateElement.id + '_h').value; mi = document.getElementById(dateElement.id + '_min').value; s = 0; return ValidateDate(y, mo, d, h, mi, s); } function CheckBlankDate(dateElement) { var y, mo, d, h, mi, s; y = document.getElementById(dateElement.id + '_y').value; mo = document.getElementById(dateElement.id + '_m').value; d = document.getElementById(dateElement.id + '_d').value; h = document.getElementById(dateElement.id + '_h').value; mi = document.getElementById(dateElement.id + '_min').value; s = 0; if(y== || mo == || d==) { return false; } return true; } This approach does not work, as I believe JQuery cannot find any input element with name datecheck. Is there any other approach that we can follow?
[jQuery] JQuery validation plugin - error highlight problem
I have a form with two input textboxes, and I have included JQuery validation rules for both: script src=../../Scripts/jquery-validate/jquery.validate.js type=text/javascript/script script type=text/javascript $(document).ready(function() { $('#respondForm').validate({ onclick: false, onkeyup: false, onfocusout: false, highlight: function(element, errorClass) { $(element).css({ backgroundColor: 'Red' }); } , errorLabelContainer: $(ul, $('div.error-container')), wrapper: 'li', rules: { 'text': { required: true , minlength: 5 , maxlength: 10 }, integer: { required: true, range: [0, 90] } } , messages: { 'text': { required: xxx_Required , minlength: XXX Should be greater than 5 , maxlength: XXX Cannot be greater than 10 }, integer: { required: is required, range: is out of range: [0,90] } } }); }); /script /head . . . input type=text id=text name=text / br / input type=text id=integer name=integer / br / input type=submit name=submit value=Submit / br / I have used: function(element, errorClass) { $(element).css({ backgroundColor: 'Red' }); } to highlight the error control. Now the problem is that in the following scenario, both the input textboxes remain highlighted (background color: red): 1. Input text with less than 5 characters in text box 1 2. Leave text box 2 blank 3. Hit submit 4. Both input text box background will be changed to red (which is correct) 5. Now enter a text which has 6 characters in text box 1(valid input) 6. Leave text box 2 empty 7. Hit submit 8. The background color for both the textboxes remains red. Where as the expectation is that the background color of text box 1 should not be red How do i resolve this problem? -- View this message in context: http://old.nabble.com/JQuery-validation-plugin---error-highlight-problem-tp26282040s27240p26282040.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jquery validation is broken that was working before
Hi, I have used jquery.validation before without any issues. I have included the jquery validation javascript in the header and this test link does not work for some reason - http://dev.ntroduction.com/?page=step3 The validation code is called before the form as I have done else where. But this page is just making me look dumb. I get the following errors on Firebug: $() is undefined [Break on this error] $().ready(function() {\ndev.ntro...ction.com (line 397) syntax error [Break on this error] }//if\nindex.ph...0track=1 (line 7) detailed error: $(#comments_container) is null [Break on this error] script type=text/javascript $(functi...true, fxSpeed: 'fast' }); }); /script\n Any help is greatly appreciated. Thanks in advance-Taza -- View this message in context: http://old.nabble.com/jquery-validation-is-broken-that-was-working-before-tp26196157s27240p26196157.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] jQuery Validation request
The following instructions are paraphrased from: http://groups.google.com/support/bin/answer.py?hl=enanswer=46608 You can unsubscribe from a group through the web interface or via email. To unsubscribe through the web interface, just click the Edit my membership link on the right-hand side of the group's homepage at http://groups.google.com/group/jquery-en/ . Then click the Unsubscribe button on the page that appears. To unsubscribe via email, send an email to jquery-en+unsubscr...@googlegroups.com --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 4, 2009, at 12:07 AM, NathanHuang wrote: Hi all Who can tell me how to unsubscribe this mailling list? I'm gonna use another account for this mailing list. thanks -- View this message in context: http://old.nabble.com/jQuery-Validation-request-tp25995270s27240p26160052.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] jQuery Validation request
Hi Richard, I also live in the Netherlands and ran into the same problem. I couldn't find an answer online so i decided to write some addon methods myself. I added the following two methods to the validator and that did the trick. $.validator.addMethod(maxNL, function(value, element, param) { var val = value.replace(,, .); return this.optional(element) || val = param; }, jQuery.validator.format(Vul hier een waarde in kleiner dan of gelijk aan {0}.)); $.validator.addMethod(minNL, function(value, element, param) { var val = value.replace(,, .); return this.optional(element) || val = param; }, jQuery.validator.format(Vul hier een waarde in groter dan of gelijk aan {0}.)); It doesn't do much more than replace a comma with a period and validate the new value. Hope this helps. Note that this probably doesn't work for numbers greater than 1000 with formatting (for example, 1.000,00). In that case you have to switch the period for a comma and the comma for a period. Greets, Bart Richard-330 wrote: Hi, I was working with validation, but am having problems using the method max for maximal numbers. I live in Holland and for us the decimal character is a comma, and I can use comma's for validating the max value of a field. Could someone please make an addon like numberDE for max? So i can check comma's. Thanks! Richard -- View this message in context: http://old.nabble.com/jQuery-Validation-request-tp25995270s27240p26160052.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] jQuery Validation request
Hi all Who can tell me how to unsubscribe this mailling list? I'm gonna use another account for this mailing list. thanks -- View this message in context: http://old.nabble.com/jQuery-Validation-request-tp25995270s27240p26160052.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] jQuery validation plug-in 1.5.5
Hi, why jQuery validation plug-in 1.5.5 don't work with FireFox version 3.5.4?
[jQuery] jQuery Validation - ajax check for email
Hi, This is my first attempt at using addMethod and it's always returning true, for some reason. This is placed outside of document.ready jQuery.validator.addMethod(checkemail, function(email) { var email = $('#email').val(); $.post(user/checkemail, { email : email }, function(data){ if(data.exists == 1) { return true; } }, json ); }, 'This email already has already been registered'); and in the validate() method, I'm calling the function like this: rules:{ email: { required: true, email: true, checkemail: true } } Is there anything obvious i'm doing wrong here? Thanks!
[jQuery] jQuery Validation request
Hi, I was working with validation, but am having problems using the method max for maximal numbers. I live in Holland and for us the decimal character is a comma, and I can use comma's for validating the max value of a field. Could someone please make an addon like numberDE for max? So i can check comma's. Thanks! Richard
[jQuery] jQuery validation and error messages
I don't really know where to start on this, but I need to take a form like: input name=username type=text id=username / pinput description/p And put an icon [the error label] next to input on success or fail; but also change the p's text on success or fail. So a fail would change the message to whatever the message was, and on success it would return it back to it's normal text. Or to make it more simple, how can I change the p's text but return it back to its default on success?
[jQuery] jquery validation plugin issue with IE 8
I have a problem with the validation plugin when I add a new validation method in IE8, when I submit the form it just validate the added method but the other fields are submitted anyway. Also I have another problem with the valid() function, when I try to see if the function is true to show a confirmation message IE8 show the javascript error: 'settings' is null or not an object Line: 788 Character: 3 There is the way I add the new validation method: script type=text/javascript $(document).ready(function(){ $.validator.addMethod(nonEmptyTable, function(value, element) { return get_table_data(); }, 'xxx.'); $(#OrdenForm).validate({ rules: { id_orden:{required:true}, fecha_sol: {required:true, dateISO: true}, concepto: {required:true}, cen_cos: {nonEmptyTable:true}, val_tot: {required:true, number:true} }, messages:{ id_orden: {required:xxx}, fecha_sol: {required:xxx}, concepto: {required:xxx }, cen_cos: {nonEmptyTable:xxx}, val_tot: {required: xxx} } }); }); /script There's how I do the submit verification to show the dialog script type=text/javascript $(function(){ $(#dialog).dialog({ bgiframe: true, autoOpen: false, height: 160, width: 330, modal: true, buttons: { 'OK': function() { document.OrdenForm.submit(); }, 'Cancel': function() { $(this).dialog('close'); } } }); $('#OrdenForm').submit(function(){ if($('#OrdenForm').valid()) { $('#dialog').dialog('open'); return false; } }); }); /script Any help will be very appreciated...
[jQuery] [jQuery][Validation] jQuery.format problem (works in IE and Chrome, don't work in Fx)
Hello. I have template like this: 1.div id=links style=display: none; 2.Stary link:a href={0}{0}/abr 3.Nowy link:a href={1}{1}/abr 4.Nowy link:input name=shorted id=shorted class=select value={1}br 5.Nowy link:a href={2}{2}/abr 6.Nowy link:input name=shorted2 id=shorted2 class=select value={2} 7./div after execution some patterns are replaced by arguments and some not. Arguments: {0} = http://wp.pl {1} = http://2h.localhost {2} = http://localhost/2h it looks like this: 1.div id=utnij align=center style=opacity: 1; 2.Stary link:a href=%7B0%7Dhttp://wp.pl/abr/ 3.Nowy link:a href=%7B1%7Dhttp://2h.localhost/a 4.Nowy link:input id=shorted class=select value=http:// 2h.localhost name=shorted/ 5.Nowy link:a href=%7B2%7Dhttp://localhost/2h/a 6.Nowy link:input id=shorted2 class=select value=http:// localhost/2h name=shorted2/ 7./div I have to add, that this bug appears only in Fx, IE and Chrome works fine. Do You know why this is happening. Thanks in advance.
[jQuery] jQuery Validation Submitting without Validation in Firefox (validate)
Hi Guys, I've put together a pretty simple competition script - it's commented out below and you can find the demo at http://www.jakeisonline.com/stackoverflow/jqueryvalidation/page/ (you'll find the code at the bottom of the page) I am using a jquery plugin to achieve the validation: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ The problem is only in Firefox (3.5.2) - the form submits without any validation at all, and ignores the ajax. IE8 7 seem to be fine. I'm not really sure why Firefox is submitting the page with Refresh but IE isn't, I've looked over and over the code and can't find the error. Firebug is only finding errors in the jQuery library itself. Can anyone help?
[jQuery] Jquery Validation plugin doesn't working on ASP NET MVC
I'm trying to use the Jquery Validation plugin on aspnet mvc fframework but it doesn't work, when I open the firebug console it display an error: jQuery is not defined [Break on this error] jQuery.extend(jQuery.fn, {\n I don´t know how to fix this issue an had already added the jquery-1.3.2.js to my scripts, there is the valdiation code I'm using: script type=text/javascript src=../../Scripts/ jquery.validate.js/script script type=text/javascript src=../../Scripts/ jquery-1.3.2.js/script script type=text/javascript $(document).ready(function(){ $(#simpleSignUp).validate(); }); /script form id=simpleSignUpForm action= method=get input type=text id=firstname class=required minlength=2/ input type=text id=lastname class=required minlength=2/ input type=text id=username class=required minlength=2/ input type=text id=email class=required email minlength=2/ input type=text id=password class=required minlength=8 / input type=text id=website class=url / input type=submit value=Submit / /form Any help will be very appreciate, Thanks in advance...
[jQuery] jQuery validation error message to specific span id
I am using jQuery validation plugin and I want that the error message to be displayed in a specific span with id=test. How do I do this?
[jQuery] jQuery validation - Numbers not allowed
I have this code: $(document).ready(function() { // validate signup form on keyup and submit var validator = $(#signupform).validate({ rules: { firstname: required, lastname: required, username: { required: true, minlength: 2, remote: users.php } } }); }); How do I set the validation that no number are allowed in the firstname text box
[jQuery] jQuery validation on 3 select box
Hi there, I had a form where I need user to input the their birthdate: select id=sel_dd name=sel_dd option value=/option option value=11/option ... /select select id=sel_mm name=sel_mm option value=/option option value=1Jan/option ... /select select id=sel_yy name=sel_yy option value=/option option value=19801980/option ... /select How do I write custom validation rule to check if user had selected appropriate input? And which control should I assign the rule on? Thanks.
[jQuery] jQuery Validation Plugin jQuery Form Plugin
Validation plug-in version: 1.5.5 Form plug-in version: 2.28 I was able to get the validation and submit to work together properly. However, when using options in the validation plugin such as errorClass and validClass I was ran into some trouble. Upon submission, these classes would stick/stay. The form data is cleared properly when using the clearform: true option association with the form plug-in. Here is a little more detail. Upon validating I was filling in the input fields' background with a light green color to show the user that this field was indeed valid and they could proceed to submit. This worked fine until submission. The form data would clear properly but the options associated with validation would stay. Is there anyway to clear all the validation options on submit? Thanks in advance!
[jQuery] Jquery Validation How To
Hi, I have a form that includes four text fields for phone numbers: Business, Home, Cell and Fax A user must fill in at least one phone number. How would I set up the validation for this? Cheers
[jQuery] jQuery validation custom method doesn't work
Hello all I have added a method on jQuery validator like this $.validator.addMethod('myEqual', function (value, element) { return value == element.value; // this one here didn't work :( }, 'Please enter a greater year!'); $.metadata.setType(attr, validate); $(#educationForm).validate({ showErrors: function(errorMap, errorList) { this.defaultShowErrors(); }, errorPlacement: function(error, element) { error.appendTo( element.parent(td).next (td) ); }, /*success: function(label) { label.text(ok!).addClass(success); },*/ rules: { txt_end: { required: true, myEqual: #txt_begin } }, submitHandler: function() { } }); the form looks like this div id=wrapper_form form id=educationForm name=educationForm method=post action= table width=500 border=0 tr td width=100Period:/td td width=200input type=text name=txt_begin id=txt_begin size=8 maxlength=4 class=required year ui-widget- content ui-corner-all / to input type=text name=txt_end id=txt_end size=8 maxlength=4 class=required year ui-widget-content ui-corner-all / /td td width=200/td /tr tr td colspan=2 input type=submit name=btn_submit id=btn_submit value=Submit class=ui-button ui-state-default ui-corner-all / input type=button name=btn_cancel id=btn_cancel value=Cancel class=ui-button ui-state-default ui-corner-all / /td td /td /tr /table /form /div but why the custom method I added didn't work? return value == element.value; // this one here didn't work :( it always return true for any value :( am I missing something here? I didn't use the built in method because later in the form I would require to write another method to check for greater or equal and lower or equal ( = and = ) I have tested this method with greater or equal and lower or equal by replacing the == with = or with = It didn't work either
[jQuery] jQuery Validation - group input field validation
Hi, How can I do validation on a group of input fields, as long as one of the 3 fields have a value then it's valid, I've managed to group them, but it's showing up with 3 error messages instead of one. How can I get it to display just the one error msg for all 3 input fields? Here's my validation js. var container = $('#errorContainer'); var validator = $(#contactform).validate({ rules: { firstname: required, lastname: required, email: { required: true, email: true } }, errorContainer: container, errorLabelContainer: $(ol, container), wrapper: 'li', meta: validate }); // test either 1 of 3 contact method is provided jQuery.validator.addMethod('required_group', function(val, el) { var $module = $(el).parents('#contactform'); return $module.find('.required_group:filled').length; }, 'Please provide either an email address, home phone or mobile for us to get in touch with you.'); -- HTML below: form action= method=get id=contactform div class=error/div ol li label for=firstnameFirst name: */label input id=firstname name=firstname class=text / /li li label for=lastnameLast name: */label input id=lastname name=lastname class=text / /li li label for=emailEmail Address: **/label input id=email name=email class=text required_group / /li li label for=mobileMobile Phone: **/label input id=mobile name=mobile class=text required_group / /li li label for=phoneHome Phone: **/label input id=phone name=phone class=text required_group / /li /ol /form
[jQuery] jquery validation plugin. Need help with passing variable to jQuery.format
I'm having some troubles with passing variables to jQuery.format I have a script (php) that's checks if the domain part exists. If not it will show an message The following code works #1 It split an email address and assigns the domain name to the var hostName $(document).ready(function() { var x = $('#email').val(); var ind=x.indexOf(@); var hostName=x.slice((ind+1),x.length); rest of script it will correctly show the var hostName in jQuery.format, but after entering another incorrect domain name it will show the first incorrect domain name I've also tried this #2 $(document).ready(function() { $(#email).blur(function () { var x = $('#email').val(); var ind=x.indexOf(@); var hostName=x.slice((ind+1),x.length); }).blur(); ...rest of script But then i got a message (firebug) that hostName is not defined #3 $(document).ready(function() { $(#email).blur(function () { var x = $('#email').val(); var ind=x.indexOf(@); var hostName=x.slice((ind+1),x.length); alert(hostName); }).blur(); .. rest of script This will show the domain name, but on loading page it will show an empty alert window I prefer method #2. How can i pass the var hostName to jQuery.format? Any help is much appreciated.
[jQuery] jQuery Validation Plugin
Can anyone tell me how i can change which attribute on my form field triggers the validation? currently it appears the be the name attribute. So in my Rails app using Rails helpers, it sets the name to somthing like formname ['fieldname'] and the whole name. in my script if i do something like rules: { formname['fieldname]: 'required' } etcit causes the script to break. I need a workaround if anyone has ever come across this problem.. Thanks in Advance
[jQuery] JQuery Validation plugin with Django (New) Forms (V1.0) - Are these compatible?
JQuery newbie question re using validation plugin with Django newform. I have a simple email feedback contact django form that I wanted to enhance with some JQuery validation. I created a standalone (Non Django) version of the form and it works correctly. However when I create a Django version of the form the validation rules seems to be ignored and the form is always posted - I would expect the form to fail, and never post. One difference (not sure if it's siignificant) is that the Django forms are created from classes/ templates and render as tables. However the exact same HTML code works for the basic form. I'm now thinking that there must be something different re how the submit is being processed for the Django form - but I'm stumped. Anyone got any ideas/things to try? TIA, Brendan Below is a simplified code (both Basic and Djange versions) sample stripped to one validation field: Basic version of the form (working): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 / script type=text/javascript language=javascript src=/media/js/ jquery-1.3.2.js/script script type=text/javascript language=javascript src=/media/js/ jquery.validate.js/script meta http-equiv=Content-Language content=en-us / meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleDjango JQuery Example/title link href=/media/css/default.css media=screen type=text/css rel=stylesheet style type=text/css pre { text-align: left; } label.error { float: top; color: red; padding-left: .5em; vertical- align: top; } /style script id=demo type=text/javascript $(document).ready(function() { // validate signup form on keyup and submit var validator = $(#contact-us).validate({ rules: { sender: required, minlength:4 }, messages: { sender: Enter sender's name, } }); return false; }); /script /head body div id=main div style=clear: both;/div /div div class=content body bgcolor=#D2FFD2 img src=/media/images/Masthead.png width=942 height=162 form method=post action= id=contact-us {% block content %} h3 {{ message }} /h3 table {{ eForm }} tr td/td td div class=submit input type=submit value=Submit value=update / /div/td /tr /table {% endblock %} /form /div /body Django version of the form below (validation not working): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 / script type=text/javascript language=javascript src=/media/js/ jquery-1.3.2.js/script script type=text/javascript language=javascript src=/media/js/ jquery.validate.js/script meta http-equiv=Content-Language content=en-us / meta http-equiv=Content-Type content=text/html; charset=utf-8 / titleDjango JQuery Example/title link href=/media/css/default.css media=screen type=text/css rel=stylesheet style type=text/css pre { text-align: left; } label.error { float: top; color: red; padding-left: .5em; vertical- align: top; } /style script id=demo type=text/javascript $(document).ready(function() { // validate signup form on keyup and submit var validator = $(#contact-us).validate({ rules: { sender: required, minlength:4 }, messages: { sender: Enter sender's name, } }); return false; }); /script /head body div id=main div style=clear: both;/div /div div class=content body bgcolor=#D2FFD2 img src=/media/images/Masthead.png width=942 height=162 form method=post action= id=contact-us h3 Django/JQuery Demo - Get Request /h3 table trthlabel for=id_subjectSubject:/label/thtdinput id=id_subject type=text name=subject maxlength=100 //td/ tr trthlabel for=id_emailEmail:/label/thtdinput id=id_email type=text name=email maxlength=100 //td/tr trthlabel for=id_msgtextText:/label/thtdtextarea id=id_msgtext rows=10 cols=40 name=msgtext/textarea/td/ tr tr td/td td div class=submit input
[jQuery] jQuery Validation Plugin - rule metadata documentation?
Are the options, usage and limitations for the jQuery Validation rules using metadata in markup, e.g., class=required date, documented anywhere? There is http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods, but that is for setting up rules in the JS.
[jQuery] jQuery Validation plugin and ASP.NET postbacks
Hi, Have anyone been able to use the jQuery validation script and been able to make the buttonclick cause a post back? The form validates fine but the post is never made. If I add the option submitHandler on the plugin it goes in there, but that does not really help as i dont want to do a ajax submit. What i want is to make the postback continue as normal if the validation is true. Anyone else manged to work around this problem? Regards, Johan
[jQuery] Jquery validation plugin question
Hello, Thanks for building this validation plugin, I like it. I have a question: The error class automatically gets added to the label with the same for= name, but for a certain error I need to change the element that gains the error class. For instance, I added this line to the error placement so that a certain element receives the error class but then realised the error class would not be removed when the error is corrected by the user: code else if (element.attr(name) == aupairLanguageList) { error.insertAfter(#multiSelect-aupairLanguageList-content); $(#multiSelect-aupairLanguageList-title).addClass(error); } /code Any Ideas? Thanks
[jQuery] Jquery Validation and Autobox2 by BigRedSwitch
Has anyone managed to get Validation working with Autobox2 by BigRedSwitch. I am fairly new to Javascript coding but I do have a basic understanding and have managed to get the Validation working on the form (which was really easy) as well as Autobox2 but they just won't be friends. Has anyone else managed this ?
[jQuery] jQuery validation and captcha
dear all, i'm working with jQuery validation to validate the fields in a form. in this form i have also the captcha (the check is verified through ajax). check the code below: jQuery.validator.addMethod(Captcha, function(value, element) { jQuery.get(/captcha.asp?validateCaptchaCode= + jQuery (#captchacode).val() + , function(data){ if (data == 1) { result = true; } return true; }); return this.required(element) || true; });
[jQuery] jQuery validation and captcha in a form
dear all, i'm trying to implement the captcha in a form where i'm using jquery validation and also custom validation methods. this is the code i have so far: jQuery.validator.addMethod(Captcha, Function(value, element) { jQuery.get(/functions/app/CaptchaAjax/captcha.asp? validateCaptchaCode= + jQuery(#captchacode).val() + , function (data){ if (data == 1) return true; }); return this.required(element) || true; }); the problem i have so far is that: if i get out from the jQuery.get function then i will loose the variable data and if i put the return this.required(element) || true; then i will get an error because the addmethod function needs it. is there i work around this? or may be another way to do it? Thanks
[jQuery] jQuery Validation Plugin ASP.NET
I've tried to get this to work for the past 4 hours and I'm stuck. I've got a master page with the following scripts added. script type=text/javascript src=/RohmPortal/scripts/ jquery-1.3.2.js/script script type=text/javascript src=/RohmPortal/scripts/ jquery.validate.js/script this is the form tag on my master page form id=form1 runat=server in the HTML output of the page, it actually renders to aspnetForm. in the content page, this is what I have script type=text/javascript $().ready(function() { $('aspnetForm').validate(); $('.TitleField').rules(add, { minlength: 2 }); }); /script here is the control I'm trying to validate asp:TextBox ID=TitleField name=TitleField Width=390 Columns=30 MaxLength=100 runat=server EnableTheming=false CssClass=TitleField / here is the error I get when testing in IE7 Microsoft JScript runtime error: '$.data(...).settings' is null or not an object when I go to the debug in VS, it shows the $.data as being undefined. What am I missing, I've tried to use a id selector as well, without any luck. I've tested my selectors by changing background colors, and they alwasy work but why isn't this thing validating? I'm probably missing something simple, any help is GREATLY APPRECIATED! Thanks, Zach
[jQuery] jquery validation on one field or another
Hi, I have a form with multiple fields, including one for a telephone number and one for an email address, i need the contact to enter in at least one of the above in the form to make it valid, how do i do an either/or check within a jquery validation form?
[jQuery] jQuery validation plugin -- how to validate an input only if it contains info
Hi -- I've got a contact form here http://www.dianlofton.com/contact.shtml ...using the jquery.validate.js plugin. The form has an optional input for a phone number, which I'd like to have validated -- but only if there is info in the input. If you look at the source code for that page, you'll see some commented out code for the phone number validation. However, when this scripting is active on the page, it makes the phone number a required field, which is not what I'm after: $.validator.addMethod(phone, function(ph, element) { if (ph == null) { return false; } var stripped = ph.replace(/[\s()+-]|ext\.?/gi, ); // 10 is the minimum number of numbers required return ((/\d{10,}/i).test(stripped)); }, Please enter a valid phone number); Any help on how to have this field be optional, but still get validated if the user inputs data, would be greatly appreciated. Thanks! --Carl.
[jQuery] jquery validation with added method
i've added this to the top of my page jQuery.validator.addMethod(pCode, function(value) { // Addon method for validating postal codes. Valid formats are (X1X 1X1) or (X1X1X1) or (X1X-1X1). return value.match(/^[a-zA-Z][0-9][a-zA-Z](-| )?[0-9][a-zA-Z] [0-9]$/); }, 'Please enter a valid postal code'); pCode works great. But when I try to put a conditional statement like this: $(myself).find(form).validate({ rules: { postalCode: { pCode: function(element) { alert($(myself).find(select[name=countryId]).val() != '800'); return ($(myself).find(select[name=countryId]).val() != '800' ); } } } the condition doesn't take. It validates my postalCode field regardless of what value is returned. the alert is even coming out as false for me and its still validating this field. I've tried hardcoding the function to false and it seems to work. Any ideas? I know its probably something stupid that I forgot
[jQuery] jquery validation question: validate a single form element onsubmit
I'm using the validate plugin, and am having a problem with simple one element forms. I have a single select list and a submit button. If the select list is empty, the validation prompts that it is required. When you choose an option, and click Submit, it validates and removes the required message, but then you have to click Submit a second time to actually submit the form... what would I need to do to have it validate the select onchange, so the submit fires the form submit? validation code: script language=Javascript/* validation for radio button forms */ // wait for the DOM to be loaded $(document).ready(function() { // validate form on keyup and submit var validator = $('#select').validate({ rules: { field: required }, messages: { field: Please select a value. } }); }); /script Any advice is appreciated.
[jQuery] jQuery + Validation: submit() is sending multiple form submits
I'm having a problem with validating first then submitting a form with jQuery after success. It works however it seems like my submit() function keeps sending multiple submits and keeps growing each time i reuse the form (i made sure the values are reset after each submit). I'm not sure if its my code since i've re-checked it for hours to no avail. Here is the code in a nut-shell: My form with id of #form-external-link is validated when submit button is clicked: $(#form-external-link).validate({ rules: { exlink_url: { required: true, url: true } }, submitHandler: function(form) { alert('This will pop up only once as it should'); $(form).submit(function() { alert('This will pop up every twice, 3x, 4x, etc. after each validate success'); }); } }); Am I missing something from my code??
[jQuery] jquery validation on non java complaint browser
Since I started messing around with jquery, I'm astonished on how simple a java web form validation is.. the problem is when a person has a non java brower or disable it, then basically the java validation is useless! Now, since I use php I also have the standard server side validation but I was wondering if there are any shortcut that I'm not aware of, what is the best practice to handle a non java browser (like disabling the form on a non enabled broser?). Please enlighten me! Thanks David
[jQuery] JQuery Validation - call validate(options) multiple times to append options to current validator [validate]
I'm wondering if it's possible to call the validate method multiple times to append more options to the validator. I haven't tried it, but it seems like it will overwrite previous options. Example psuedo code: var formValidator = $(#myForm).validate(options1); formValidator += $(#myForm).validate(options2); The idea behind this is to build validators using existing options without rewriting them all, and they may not be stored in the same options object. If my above example is incorrect, what is the proper way? Thanks
[jQuery] Jquery validation not working in thick box
Hi Why Jquery validation not working in thick box ? pls advise me thanks for advance
[jQuery] jquery validation plugin and hidden elements
Hi, I have been using a prototype form validation http://tetlaw.id.au/view/javascript/really-easy-field-validation but I now wish to go to jquery. I can get it working but there is something i can't get to work and it was the best feature of the prototype script mentione above. I would like the validation script to exclude from the process any hidden form field. I set the validation rules as metatags with class=required the following works but still requires to validate hidden fields $(#commentForm).validate(); I have tried something like.. $(#commentForm).validate({ignore: [...@type=hidden] }); but that does not work Some fields are hidden because the parent div is set to display:none when a checkbox is checked. Any ideas?
[jQuery] jquery validation on remote rule requires two submits
I am using the validate plugin with a form that has one select element and no other elements. I am using the required and remote rules to validate this element. When I click submit the first time, it performs the remote validation, but doesn't submit the form. A second click on the submit button then submits the form. I'm trying to figure out why it's not submitting on the first click? The code below shows both client and server side action. I am seeing on the first click that remote.php returns 'true' via Firebug, but for some reason doesn't submit the form, it only performs the remote validation and then stops... Any advice is appreciated client side: $(document).ready(function() { var validator = $('#my_form').validate({ rules: { field: { required: true, remote: remote.php }, }, messages: { field: { required: Please specify a value, remote: jQuery.format(Please specify another value.) }, }, }); }); form action= method=post name=my_form id=my_form select name=field option value= - /option option value=1some_value/option option value=2some_other_value/option /select input type=submit name=submit value=Submit /form Server Side (remote.php) ?php $valid = 'true'; // do a database lookup or similar action... if($_REQUEST['field'] != $database_lookup_result) $valid = 'false'; echo $valid; ?
[jQuery] jquery validation
How can i add ID=error instead of a class using jquery. Also is there a way to say that you must uncheck the box before submitting the form. Im using http://jquery.bassistance.de/validate/demo/milk/ as an example. Also is there a way to use jquery to show/hide passwords, i done it using js but i want to use jquery I want to add these. Can anyone help
[jQuery] Jquery Validation always not showing correct error message
My Jquery validator refuses to show the correct error message but rather the default error message every time the validation fails. I am doing 3 things. First $.validator.addMethod(regexValidator0, function(value) { return /^\(?\b([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9] {4})\b$/.test(value); }, Invalid); I add a method to the validator. Next I call the Validate method $(#aspnetForm).validate({ errorLabelContainer: $(div.error) }); Next I add a rule $('#myelement).rules('add', {regexValidator0:true,messages: {regexValidator0:'Please enter a valid phone number'}}); Now when my rule doesn't pass validation, I don't get the error message I specified in my rule, but rather the default message Invalid when I added the rule. Am I doing something wrong here, or is this a bug? Thanks
[jQuery] JQuery Validation Dynamic updates
I have javascript code that alters the values inside the validate attribute set on a ui element. An example of what I change is validate=required:true, messages{required:'Please give a value} to validate=required:true,messages{required:'Give a different value'}. This is changed via javascript and I find that the validation does not recognize these changes to the attributes. Is there anything I am supposed to call to make the framework recognize these changes that were made on the fly? Thanks, K
[jQuery] jquery validation and disabled elements
How can I tell the bassistence validator to ignore disabled inputs? I have ui.tabs, and only the selected tab's controls are enabled. I want validation to fire only at them. -- Jan
[jQuery] jquery validation trailing comma error
Hey guys, i read about that trailing comma error in several other posts, but i just can't fix that problem. IE7 still submits the form even if the required fields are empty. Here's my jquery code: Hope you can help me. thanks in advance. var validator = $(#adventsform).validate({ rules: { anrede: { required: true }, vorname:{ required: true }, nachname: { required: true }, email: { required: true }, agb: { required: true } }, messages: { anrede: Bitte ausfuellen, vorname: Bitte ausfuellen, nachname: Bitte ausfuellen, email: Bitte ausfuellen, agb: Die AGBs muessen akzeptiert werden }, // the errorPlacement has to take the table layout into account errorPlacement: function(error, element){ if (element.is(:radio)) error.appendTo(element.next().next()); else if (element.is(:checkbox)) error.appendTo(element.next().next()); else error.appendTo(element.next()); }, // set this class to error-labels to indicate valid fields success: function(label){ // set as text for IE //alert(passt); label.html( ).addClass(checked); } });
[jQuery] jQuery Validation
Hi, I'm trying to add new rule to the validation plug in, so far with a little success. I want to use the validation against 2 text boxes, and compare them to each other. The values must be numbers only and the first textbox value number should by smaller than the other one. How can I accomplish it?
[jQuery] jquery validation
Hi JQuery validations is very good work. i need how to display the error messages using effects(like fadein and fadeout) it is very urgent kindly help me thanks for advance
[jQuery] jquery validation: manually set the form validity state?
I have a form that is split into 3 different tabs. You can only move to the next tab if the part of the form on the current tab is valid. I have 3 separate validator code sections each with their own rules and messages. I attach an onclick handler to the custom button to return ('#myForm').validate().form() and if it returns true to move on to the next tab. However, on the next tab I can click the next button and it moves on, even though all the fields should have errors. I assume that maybe the overall state of the form is valid, so calling .form() again returns true. I'm wondering what the best solution is to validating a form split into 3 different tabs. I was thinking that when a tab opens, you set the form valid state (if it's possible) to false everytime. But I wonder if then once you call .form() it returns false no matter what since you manually set it? This seems like a quick fix and possibly bad idea, anybody have any suggestions?
[jQuery] jquery validation unhighlight issue
my js is as follows: var validator = $('#myForm').validate({ onfocusout: false, onkeyup: false, rules: { prefix: { required: true }, name: { required: true } }, messages: { prefix: { required: 'Please select a prefix' }, name: { required: 'Please provide your name' } }, errorClass: 'formError', highlight: function(element, errorClass) { $(element.form).find('label[for=' + element.id + ']').addClass(errorClass); }, unhighlight: function(element, errorClass) { $(element.form).find('label[for=' + element.id + ']').removeClass(errorClass); } }); and my html: fieldset label for=prefix*Prefix:/label input id=prefix name=prefix type=text class=field / /fieldset fieldset label for=name*Name:/label input id=name name=name type=text class=field / /fieldset and I am using jquery 1.2.6 with jquery validation 1.4 When I submit with errors both labels get the errorClass attached which is what I want. But when I fix the errors and submit again, the labels disappear and it seems are getting a style=display;none instead of running the unhighlight method. Also, if I put an alert statement inside the unhighlight method it seems once you submit with no errors each corrected field spits out the alert twice. Any ideas? How do I get the unhighlight to remove the class instead of making the label disappear?
[jQuery] jquery validation using thickbox
Hi, Sorry to bother you but I am not able to solve this problem so posting in forum I am using two jquery plugin 1 Thickbox 2 Jquery validation Without thickbox validation is working fine but validation is not working in thickbox. There is two files ajaxLogin.htm and second is index.html ajaxLogin.htm : script src=/thickbox/js/jquery.js type=text/javascript/script script src=/thickbox/js/jquery.validate.js type=text/ javascript/ script script $(document).ready(function() { // validate signup form on keyup and submit var validator = $(#signupform).validate({ rules: { password: { required: true, minlength: 5 }, password_confirm: { required: true, minlength: 5, equalTo: #password } }, messages: { password: { required: Provide a password, rangelength: jQuery.format(Enter at least {0} characters) }, password_confirm: { required: Repeat your password, minlength: jQuery.format(Enter at least {0} characters), equalTo: Enter the same password as above } }, // the errorPlacement has to take the table layout into account errorPlacement: function(error, element) { error.appendTo( element.parent().next() ); } }); }); /script div id=signupwrap form id=signupform method=POST action=http://localhost/thickbox/ index.html table tr td class=labellabel id=lpassword for=passwordPassword/ label/td td class=fieldinput id=password name=password type=password maxlength=50 value= //td td class=status/td /tr tr td class=labellabel id=lpassword_confirm for=password_confirmConfirm Password/label/td td class=fieldinput id=password_confirm name=password_confirm type=password maxlength=50 value= //td td class=status/td /tr /table input id=signupsubmit name=signup type=submit value=Signup / /form /div --- index.html : head style type=text/css media=all @import css/global.css; /style script src=/thickbox/js/jquery.js type=text/javascript/script script src=/thickbox/js/thickbox_plus.js type=text/javascript/ script /head body lia href=ajaxLogin.htm?height=500amp;width=550 class=thickboxThickBox login/a /body /html Please tell me how can I get validation in thickbox? Thanks
[jQuery] jquery validation
Hi, I am using Jquery plugin for client side validation. But due to a filedname I am facing a problem. Example var validator = $(#UserSignupForm).validate({ rules: { data[User][username]: { required: true, minlength: 2, remote: users.php } }); HTML :input id=id_username1 name=data[User][username] type=text value= maxlength=50 / When I am using data[User][username] as a filed name in jquery validation, it's not working but in case of other name like username it's working. I think there is problem of [][] (bracket of array). But I can not change data[User][username] so I want to use id_username1 instead of filename in validation plugin but don't know how to use ID ?. Is there any other solution? Also I have to face same problem in many plugins becuase CakePHP return name like data[User][username] so How can I override a name from ID? Please Help me Thanks
[jQuery] jQuery validation plugin - Italian Translation
filename: messages_it.js /* * Traduzione dei messaggi di default per il pugin jQuery validation. * Language: IT * Traduzione a cura di Davide Falchetto * E-mail: [EMAIL PROTECTED] * Web: www.d4solutions.it */ jQuery.extend(jQuery.validator.messages, { required: Campo obbligatorio., remote: Controlla questo campo., email: Inserisci un indirizzo mail valido., url: Inserisci un indirizzo web valido., date: Inserisci una data valida., dateISO: Inserisci una data valida (ISO)., number: Inserisci un numero valida., digits: Inserisci solo numeri., creditcard: Inserisci un numero di carta di credito valido., equalTo: Il valore non coincide., accept: Inserisci una valore con una estensione valida., maxlength: jQuery.format(Non inserire più di {0} caratteri.), minlength: jQuery.format(Inserisci almeno {0} caratteri.), rangelength: jQuery.format(Inserisci un valore compreso tra {0} e {1} caratteri.), range: jQuery.format(Inserisci un valore compreso tra {0} e {1}.), max: jQuery.format(Inserisci un valore minore od uguale a {0}.), min: jQuery.format(Inserisci un valore maggiore od uguale a {0}.) });
[jQuery] Jquery validation messages repeating
When i press the submit button of a form, it is showing the corresponding error message by the side of the text field. But when i press the submit button again, the error message is getting concatenated with the older one and getting displayed (means it is displaying that many times the submit button is clicked ) Eg: *Required *Required I pressed the submit button 2 times
[jQuery] JQuery Validation Script within a Step Wizard Script
I like to incorporate the Validation scripting into a Step Wizard http://worcesterwideweb.com/jquery/wizard/; I got it pretty much licked except the section where it only validates the available step and ignores the others. I pretty much followed the same layout as in this demo http://jquery.bassistance.de/validate/demo/multipart/ the part I am getting confused with is how it is determining the index in the match function. Is this part of the validate scripting or found in the accordion scripting? Has anyone successfully merged the 2 together? http://jquery.bassistance.de/validate/ and http://worcesterwideweb.com/jquery/wizard/ Any help would be much appropriated.
[jQuery] jQuery validation use different event for differernt input
Hi all, Some question on the validation plugin. Say there are 3 fields, and the first one is user name.I want to check the availability of the user name on focusout using 'remote'. But for the rest of the fields, only validate when user clicking submit button. Can I do that? -- Best Regards, Jacky 網絡暴民 http://jacky.seezone.net
[jQuery] jquery validation plugin problem in textarea [validate]
I use jquery validation plugin from bassistance.de, but everytime i use it on textarea, it doesnt work (doesnt pass the value properly). Any suggestions?
[jQuery] jQuery Validation Question on remote rule
Hi All, I just have few questions about the use of jQuery Validation remote rule. How remote rule treat data being passed through querystring? What is the form of data being passed through querystring? Is it case sensitive? I hope you can give me answers to those questions. Thanks, Nimrod
[jQuery] jQuery Validation Opera Issue
I used a text area as one of the field inside my form. I didnt put any validation rule on it but why i am receiving a validation message Please enter no more than 0 characters. ? This only appears on Opera. Any idea?
[jQuery] jQuery Validation Error
Hello all, I'm using jQuery 1.2.6 and Validation 1.3, and I'm getting an error message in my firebug console when I click (for the first time) any field in my form. Error: validator is undefined /js/jq/jquery.validate.js Line 291 My jQuery code is as follows: $(document).ready(function(){ // There is a bunch of other code here that inits animations on the page and stuff. $(#errorDiv).hide(); $(#submitGame).validate({ rules: { submitGame[creator]: {required: true}, submitGame[gameTitle]: {required: true}, submitGame[gameSummary]: {required: true}, submitGame[gameDetails]: {required: true} }, messages: { submitGame[creator]: {required: You must specify if you are the creator personally or the leader of a team.}, submitGame[gameTitle]: {required: Please enter the title of your game.}, submitGame[gameSummary]: {required: Please enter a summary of your game.}, submitGame[gameDetails]: {required: Please enter the details of your game.} }, errorContainer: #errorDiv, errorLabelContainer: #errorDiv ul, wrapper: li, submitHandler: function() { alert(Submitted!) } }); }); I've tried rolling jQuery back each version to 1.2.2 with it throwing the same error. Any ideas? Thanks! Sam
[jQuery] Jquery validation
HI, We are trying to use Jquery validation plugin for client side validation. It is working okay. The error message displays if the form validation fails. But we need the error display to highlight the entire row including the label and the input element. Is there a way to do this in JQuery Validation plugin? div label for=firstnameFirstname/label input id=firstname name=firstnamet / /div Basically we need to color the entire div element red.
[jQuery] jQuery Validation Plugin noConflict issue
Hi, I'm trying to use the latest version of jQuery and the validation plugin. However, when I try to use jQuery.noConflict() I show 1 error speficying that $ is not a function. Any help regarding this issue will be fully appreciated! Ale
[jQuery] jQuery Validation Plugin
Hi, In the documentation of the jQuery Validation Plugin, by default the form is not sent if invalid. By default, the form submission is prevented when the form is invalid, and submitted as normal when it is valid. In my case this is not true. How can I debug this?
[jQuery] jQuery Validation Plugin
Hello, Has anybody use the jQuery Validation plugin with Ruby on Rails. I am having trouble with it. It seems only function when the form use the get action, but not with post. Thanks Juanma Cervera
[jQuery] jquery validation demo errors
Jörn, (or anyone that knows of some alternate links) In Firefox 2.x this page throws a js error when it loads, and doesn't seem to work: http://jquery.bassistance.de/validate/demo-test/radio-checkbox-select-demo.html error (from Firebug console): $.meta has no properties $.meta.setType(attr, validate); This page throws it, too: http://jquery.bassistance.de/validate/demo-test/custom-methods-demo.html Just letting you know. Thanks, Jack
[jQuery] JQuery Validation plugib version 1.2?
HI Jörn? is version 1.2 ready? Thanks
[jQuery] jQuery Validation plugin and Tabs plugin
Hi... Anybody can tell me about how can I use jQuery Plugin Validation and Tabs plugin, because they can't work... this is my javascript source code: script type=text/javascript src=/js/jquery.pack.js/script script type=text/javascript src=/js/validate/jquery.validate.js/ script script type=text/javascript src=/js/validate/jquery.metadata.js/ script script type=text/javascript src=/js/tabs/jquery.tabs.pack.js/ script script type=text/javascript src=/js/tabs/ jquery.history_remote.pack.js/script script type=text/javascript $().ready(function() { $(#aggiungi_utente).validate({ rules: { rag_soc: required, piva: required, mail: { required: true, email: true }, conferma: required }, messages: { rag_soc: Devi indicare la ragione sociale/nome e cognome della societagrave;/utente da registrare., piva: Devi indicare la P. IVA o il codice fiscale della societagrave;/utente da registrare., mail: { required: Devi indicare la casella di Posta elettronica della societagrave;/utente da registrare., email: Devi indicare un indirizzo di posta elettronica corretto. }, conferma: Devi spuntare la cesella per poter effettuare la registrazione. } }); $(#menu-tab).tabs({ fxSlide: true, fxFade: true, fxSpeed: slow}) }) /script thank you
[jQuery] jQuery Validation Fails in IE
Hi; I implement the jQuery Validation plugin(http://bassistance.de/jquery- plugins/jquery-plugin-validation/) to my order form which you can see in http://nexus.di-tasarim.com/index.php?option=com_nexusact=gallerytask=orderid=32 it works great in Firefox but I cannot succeed to work in in Internet Explorer checked again and again every line of code but cannot find anything wrong, please help me about that tHanks...
[jQuery] jQuery Validation Multiple Forms...
What's the rationale behind the validate plugin only handling one jQuery object? This doesn't seem consistent with how jQuery works at all. The website states: Validating multiple forms on one page: The plugin can handle only one form per call. In case you have multiple forms on a single page which you want to validate, you can avoid having to duplicate the plugin settings by modifying the defaults via $.validator.defaults. Use $.validator.setDefaults({...}) to override multiple settings at once. But I have a serious problem with this... first off, I don't want to validate every form on my page. I have a number of widgets that utilize forms that don't need validation on the client side. What I would love is to be able to do something like: $('form.classOfForms').validate({}); And have my validation apply simultaneously to all of the forms with that class, just like most other jQuery plugins would do, as well as the core. Why wouldn't validate() work like submit()? For now I'm doing this... $('form.classOfForms').each(function() { $(this).validate({}); }); But as I said... this seems unnecessary, and it doesn't strike me as the jQuery way. Any idea why this is done the way it is, or if this can be fixed to behave more jQuery esk? Thanks, - Stan Lemon
[jQuery] jquery + validation + ajaxForm + tabs - almost working... (interesting problem!)
Dear All, First of all the links to sample pages. First working sample: http://www.torli.pl/valid/index-val.php and (if someone want use this mix): http://www.torli.pl/valid/valid.zip Description (how i want it to work): 1. there are two tabs: tab #1 is enabled, tab #2 id disabled. 2. there are separate forms in two tabs 3. when the user fill the value in Field 1 in tab #1 and push Submit button, tab #2 become enabled and triggered 4. if user leave empty Field 1 or for some reason validation of form1 in Tab #1 will be unsuccessfull then the warning message will show up, form submit fails and tab #2 remain disabled What is wrong: the validation is working, because the message for Field1 validation is displaying, but i can't figure out why the form is submited and tab#2 enabled and triggered, when validation for Form1 in Tab1 is unsuccessfull. Thanks for any help or suggestions. Best regards Sławek
[jQuery] jquery validation and error div...help
hey. is there a way to manipulate only error div of specipic field? like if i got: label uaboutme222 /label input name='uaboutme' type='text' id='MyForm1uaboutmeInputfield' value='dsadsad' maxlength='45' / /div the error div that its generates its : label for='MyForm1uaboutmeInputfield generated=true class=errorPlease enter a value of at least 2 characters./label so i want to do somthing like label #'MyForm1uaboutmeInputfield { postion : left 1px... color:red } got me? change only the spepic field div propetiy.. is that possible? -- View this message in context: http://www.nabble.com/jquery-validation-and-error-div...help-tf3543666s15494.html#a9892649 Sent from the JQuery mailing list archive at Nabble.com.