I'm trying to create a credit card field with 4 inputs with maxlength=4 that auto-tab.
Since the built in credit card field has only one input, and doesn't actually save the card number (yes I'm aware of the security issues and we will meet security standards when the site goes live) I'm using the list field with 4 columns to create my field. Then I've used the gform_column_input_content filter to add maxlength=4.
My problem now is that I can't seem to get any javascript to hook into those fields. I'm using
<script type="text/javscript">
jQuery(function() {
jQuery('#field_4_15 input').keyup(function(){
if (jQuery(this).val().length == jQuery(this).attr("maxlength")) {
jQuery(this).next('input').focus();
}
});
});
</script>
To move to the next field, but even just putting a simple alert on the keyup event isn't working.
Is there anything in the Gravity Forms javascript that could be inhibiting this? Can anyone see if I'm doing anything wrong? I'm not getting any errors with it, it just isn't doing anything.
My test site is http://kristarella.dreampowercostumes.com/
The actual form is in the checkout procedure, if you want to see the form please add something to the cart and navigate through the checkout pages (choosing credit card payment) until you see a credit card form.