jquery-validate

jQuery Validate ajax not working for Captcha check

心不动则不痛 提交于 2019-12-12 04:56:42
问题 This is my code: $.validator.addMethod('checkCaptcha', function(value) { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: baseURI + '/ajax-process/?rand=' + new Date().getTime(), async: true, cache: false, dataType: "json", data: 'controller=validate_captcha&c_value=' + value, success: function (jsonData) { console.log(jsonData.check_result) // It return true. if (jsonData.check_result) { return true; } reuturn false; }, error: function (XMLHttpRequest, textStatus,

MVC4 graphical validation for text box

非 Y 不嫁゛ 提交于 2019-12-12 04:45:02
问题 I got a problem in MVC4 validation.Currently, i use validationMessageFor for error message. It is not so beautiful so i want to change my validation. i want to do graphical validation. for example, i want to validate Email in Entry form. if the email is valid, my text box will look like the following. if email is wrong, i want to show the user to following. in MVC4, is it possible to do it? how should i design my text box to get according to the picture? how to add tick icon and cross icon in

Adding custom cient-side form validations to Spree frontend

≡放荡痞女 提交于 2019-12-12 04:28:19
问题 I am trying to add a custom, client-side validation to an input field in Spree's checkout/address page. So, here is what I have done so far: Add the input to the form (here using Haml & SimpleForm): = form.input :vat_number, label: Spree.t(:vat_number) Inside my vendor/assets/javascripts/spree/frontend/checkout/address.js.coffee , add the jQuery validate method and insert the rule into the validate() call: ($).validator.addMethod "vatNumber", (value, element) -> return false , "Something

jQuery Validate Remote redirect page on false

为君一笑 提交于 2019-12-12 03:54:41
问题 I am using jQuery Validate remote to check a php file and see if an email address is already in use. It works fine, however, I need it to redirect to a new page IF the email typed in already exists or "false". Below is the working remote validate script and simple php file. Again this works fine, just not sure how to redirect to a new page if the php script returns false. rules: { fullname: "required", email: { required: true, email: true, remote: { url: "validate-email.php", type: "post", },

Submit Handler not working

末鹿安然 提交于 2019-12-12 03:48:48
问题 The code I am using below is validating correctly but not submitting when fields are valid: <script> $(document).ready(function(){ $("#verifyformDesktop").validate({ errorContainer: "#messageBox1, #messageBox2", errorLabelContainer: "#messageBox1 ul", wrapper: "li", debug:true, submitHandler: function(form) { form.submit(); } }) }); </script> <form name="verifyformDesktop" id="verifyformDesktop" action="php/verify.php" method="post"> ... <input type="submit" name="submit" id="submit" value=

Android + PhoneGap + jQuery Validate - not firing

南楼画角 提交于 2019-12-12 03:45:31
问题 I'm using jQuery Mobile with jQuery Validate. I have multiple forms that post with ajax serialize once all pages have been completed. The 'next' button below works on iOS and Android when accessed from the native browser. When I package with PhoneGap and run on Android, the validation does not fire. Everything else works fine. If I remove the valid() condition, the button works as expected. So it must be an issue with how I'm using jQuery Validate. I've tried shifting the order of things in

jQuery validate() MVC 4 Uncaught Type Error Object [object Object] has no method 'validate'

醉酒当歌 提交于 2019-12-12 03:45:28
问题 I'm making a a MVC 4 application. I'm trying to apply some client side validation using jQuery validate. I keep receiving "Uncaught Type Error: Object [Object object] has no method 'validate'". I've tried using the url links instead of the scripts in my project. I've checked the scripts, they do exist. I've dragged and dropped the scripts into the file to ensure the path is properly specified. I've tried a ton of other things, but just can't figure out why I'm receiving this error. Here is my

Override jQuery validation highlight / unhighlight methods

大兔子大兔子 提交于 2019-12-12 03:44:42
问题 I want to override the highlight and unhighlight functions in jQuery validator to do what they normally and also add a different class to a parent element. Basically I want this: (Where I need help wish the base.. part) jQuery.validator.setDefaults({ highlight: function(element, errorClass, validClass) { base.highlight(element, errorClass, validClass); element.parents('div.form-group').addClass('has-error'); }, unhighlight: function(element, errorClass, validClass) { base.unhighlight(element,

jQuery Image Validation For Dynamically Cloned Form

南笙酒味 提交于 2019-12-12 03:44:12
问题 I have a form in my HTML that will get cloned and appended dynamically when the user hits the #addOne button. The form gets validated successfully for any input errors, the only problem that I am facing right now is that it's not working correctly for images. Let's say I upload an image for the first form, it works perfect. But when I click the #addOne button and upload an image for the second form, that's when the problems arise. Prior to even uploading an image for the second form, it's

How to validate fields tied to radio buttons?

自闭症网瘾萝莉.ら 提交于 2019-12-12 03:38:35
问题 I have a contact form which requires a name, method of contact (email or telephone), an email or telephone text-field(depending on which radio button is clicked) and a description. I'm validating with jQuery's Validation plug in. The email field appears when one clicks on the email radio button and the same for the telephone field. My question is how would the code look to validate the email text-field when the email radio button is clicked and validate the telephone text-field when the