WPIntell

Source evidence

Fix for Multiple Page forms

Gravity Forms Auto Placeholders · support · 2014-08-08T17:25:00+00:00

complaintsentiment
mediumseverity
0.75relevance
0replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 25 rows with source links

20.0% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

20 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
travis.hoglund unresolved
The plugin did exactly what I needed it to do on the first page of the form, but did not work on additional pages. It was a simple fix, please build it into a future release: function gfap_script() { ?> <script> function vf_add_gf_placeholders() { // Convert label to placeholder <?php $gfap_class_pc = get_option(‘gfap_class’); if ($gfap_class_pc) { $gfap_class = ‘gfap_placeholder’; } else { $gfap_class = ‘gform_wrapper’; } ?> jQuery.each(jQuery(‘.<?php echo $gfap_class; ?> input, .<?php echo $gfap_class; ?> textarea’), function () { var gfapId = this.id; var gfapLabel = jQuery(‘label[for=’ + gfapId + ‘]’); jQuery(gfapLabel).hide(); var gfapLabelValue = jQuery(gfapLabel).text(); jQuery(this).attr(‘placeholder’,gfapLabelValue); }); // Use modernizr to add placeholders for IE if(!Modernizr.input.placeholder){jQuery(“input,textarea”).each(function(){if(jQuery(this).val()==”” && jQuery(this).attr(“placeholder”)!=””){jQuery(this).val(jQuery(this).attr(“placeholder”));jQuery(this).focus(function(){if(jQuery(this).val()==jQuery(this).attr(“placeholder”)) jQuery(this).val(“”);});jQuery(this).blur(function(){if(jQuery(this).val()==””) jQuery(this).val(jQuery(this).attr(“placeholder”));});}});} // Ends allowance of jQuery to jQuery shortcut } // Start allowance of jQuery to $ shortcut jQuery(document).ready(function($){ vf_add_gf_placeholders(); }); jQuery(document).bind(‘gform_page_loaded’, function(event, form_id, current_page){ vf_add_gf_placeholders(); }); </script> <?php } add_action(‘wp_head’, ‘gfap_script’); Basically, you only bound the placeholders to the original document ready, but this does not fire on AJAX enabled paged forms. Use the gform_page_loaded hook to make this work for AJAX, as seen above. https://wordpress.org/plugins/gravity-forms-auto-placeholders/

Comments

0 shown

No comments were stored for this source.