Last active
November 19, 2019 15:44
-
-
Save New0/2942259b790256d5b5107eb16bbb9323 to your computer and use it in GitHub Desktop.
//Example of adding a tabindex to radio fields options in Caldera Forms
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: CF tabindex on radio options | |
* Autor: New0 | |
* Description: Add tabindex on options of radio fields in CF | |
*/ | |
//Example of adding a tabindex to radio fields options in Caldera Forms | |
// If there are multiple radio fields on same page, target each field using the field ID between caldera-grid and radio classes. | |
//Like ".caldera-grid #fld_8471527_1-wrap .radio label input" replacing #fld_8471527 by the field ID ( and keeping _1-wrap attached). | |
add_action( 'wp_footer', function() { | |
echo '<script> | |
jQuery(".caldera-grid .radio label input").each(function (i) { jQuery(this).attr("tabindex", i + 1); }); | |
</script>'; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment