Greetings! I'm Aneesh Sreedharan, CEO of 2Hats Logic Solutions. At 2Hats Logic Solutions, we are dedicated to providing technical expertise and resolving your concerns in the world of technology. Our blog page serves as a resource where we share insights and experiences, offering valuable perspectives on your queries.
Occasionally in our series of articles, we want to address some tips to resolve some type of issues which may occur in Gravity forms. We were working on a project last day and we had a problem with the Placeholder text in the gravity form. Placeholders were missing in the gravity form after Ajax post. Surprisingly, this fix is not built-in to Gravity Forms (Yet). However we can insert them even after submitting the form by ajax using javascript.
You can use these codes to avoid these kind of issues.
1 2 3 4 5 6 7 | //Setting placeholder before form submit/ page load.. jQuery(document).ready(function(){ jQuery('#input_1_1').attr('placeholder', 'First Name'); }); |
1 2 3 4 5 6 7 8 9 | //Set placeholder after submit the form. jQuery(document).bind('gform_post_render', function(){ jQuery('#input_1_1').attr('placeholder', 'First Name'); }); |