[Plugin: Contact Form 7] How to Tab through Contact 7 form fields
-
I have been configuring contact 7 forms for a client – and I can’t figure out how to make the fields ‘tabbable’ I know about adding tabindex=”1″ etc to the actual fields – but since contact 7 generates the input/textarea tags I cannot add them in myself. Any recommendations?
—-
Also I figured out how to do blur,focus, and after focus effects for the contact7 form fields using jquery
here is the tutorial I used: https://buildinternet.com/2009/01/changing-form-input-styles-on-focus-with-jquery/
Below is what I came up with if anyone wants to apply it to their own contact-7 form:
<script type="text/javascript" src="https://-----/scripts/jquery-1.5.1.min.js"></script> <script type="text/javascript"> //use jquery instead of $ for wordpress conflicts jQuery(document).ready(function(){ // first add idle-field class to all form inputs jQuery('input[type="text"],textarea').addClass("idle-field"); // then on focus remove idle-field and add focus-field also clear default value jQuery('input[type="text"],textarea').focus(function() { jQuery(this).removeClass("idle-field completed-field").addClass("focus-field"); if (this.value == this.defaultValue){ this.value = '';} if(this.value != this.defaultValue){ this.select(); } }); // on blur after focus remove focus class and add completed-field class jQuery('input[type="text"],textarea').blur(function() { jQuery(this).removeClass("focus-field").addClass("completed-field"); }); //end }); </script>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: Contact Form 7] How to Tab through Contact 7 form fields’ is closed to new replies.