Created
February 17, 2013 20:57
-
-
Save WebEndevSnippets/4973424 to your computer and use it in GitHub Desktop.
Gravity Forms: Make Gravity Form Field Read Only (first page of multi-page or a single page)
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
add_filter( 'gform_pre_render_20', 'webendev_add_readonly_script' ); | |
/** | |
* Make Gravity Form Field Read Only (first page of multi-page or a single page) | |
* | |
*/ | |
function webendev_add_readonly_script($form){ | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
jQuery("li.gfield.readonly input").attr("readonly","readonly"); | |
jQuery("li.gfield.gf_readonly textarea").attr("readonly","readonly"); | |
}); | |
</script> | |
<?php | |
return $form; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment