Pre populate Hidden input in Gravity Forms

This is the code I used to prepopulate a hidden field in Gravity Forms so that i could send users to different pages depending on what was in the field. /* CHECK FOR EVENTS and populate HIDDEN FIELD pre submission*/add_filter( “gform_pre_submission_23”, “check_for_events”, 9 );function check_for_events( $form ){ $ip=$_SERVER[“REMOTE_ADDR”]; //print_r($ip); exit(); $event_check = geoCheckIP($ip); //print_r($event_check[‘town’]. ‘, Read More…

User Profile Meta

You can add or get rid of User profile fields in the backend by using the code on this page. http://davidwalsh.name/add-profile-fields I also created a profile page to keep track of progress for each user that is logged in using Gravity Forms. These are the steps I used: Create a Form that has checkboxes. Install Read More…

Read Only Textarea

Use this in your functions.php file to change a textarea to readonly. // update ‘2’ to the ID of your form add_filter(‘gform_pre_render_2’, ‘add_readonly_script’); function add_readonly_script($form){     ?>     <script type=”text/javascript”>         jQuery(document).ready(function(){             jQuery(“li.gf_readonly textarea”).attr(“readonly”,”readonly”);         });     </script>     <?php     return $form; } Then add  the .gf_readonly class to your textarea in the Read More…

Unique code validation – gravity forms

I used this code to validate a specific unique code that you have to fill out in order to register on the taxlientrainer.com website.   // UNIQUE code validation. Checks to see if a valid promo code was entered // 1 – Tie our validation function to the ‘gform_validation’ hook add_filter(‘gform_validation_3’, ‘validate_code’); function validate_code($validation_result) { Read More…

Placeholder Text

Add placeholder text for gravity forms with Gravity Forms – Placeholders add-on plugin. Then add the class gplaceholder to the form.   You can also use this code <script type=”text/javascript”> jQuery(document).ready(function($) { jQuery.fn.cleardefault = function() { return this.focus(function() { if( this.value == this.defaultValue ) { this.value = “”; } }).blur(function() { if( !this.value.length ) { this.value = Read More…