jquery-form-validator

Adding a click event listener in script not working

六眼飞鱼酱① 提交于 2020-01-07 04:21:08
问题 I'm trying to change the color in a text box from blue to red on click, however, it's always red, the event listeners not working for some reason. function formFun() { var textBox1 = document.forms[0].elements[0]; var textBox2 = document.forms[0].elements[1]; var button1 = document.forms[0].elements[2]; var button2 = document.forms[0].elements[3]; textBox2.style.backgroundColor = "blue"; button1.style.backgroundColor = "blue"; button2.style.backgroundColor = "blue"; button1.addEventListener(

Html5 form validation with required and disabled element

[亡魂溺海] 提交于 2019-12-18 07:42:22
问题 I realize that you should never disable an element and also require it, because how could the user make it valid if it's disabled? However, I have a <select> of products that I want my users to choose from. When they select one of the products another <select> for the product's models is populated, enabled, and required only if the product has one or more models . Otherwise, the model select is disabled and emptied. While I like to think that my code is perfect and I can make it so that the

reCaptcha v2 in conjunction with jQuery-Form-Validator

允我心安 提交于 2019-12-11 04:18:11
问题 I'm using the jQuery-Form-Validator. Now I want to integrate reCaptcha v2 into my form. The conjunction between both reCaptcha and the validator is somewhat unclear and hardly explained on the official website of the validator. I'm not searching a general solution to incorporate reCaptcha into a form because I know what to do. But I want to know how to do it with the above mentioned validator. Google wants you to paste <div class="g-recaptcha" data-sitekey="your_site_key"></div> The validator