Javascript error on hidden form elements without ID
-
Hi,
Tested in Chrome and Firefox, a javascript error is raised when the plugin tries to set the placeholder on an element without ID, e.g. input type=”hidden”.
I have created a little patch for this.
--- a/gravity-forms-auto-placeholders/gravity-forms-auto-placeholders.php +++ b/gravity-forms-auto-placeholders/gravity-forms-auto-placeholders.php @@ -86,6 +86,9 @@ jQuery(document).ready(function($){ } ?> $.each($('.<?php echo $gfap_class; ?> input, .<?php echo $gfap_class; ?> textarea'), function () { + if (!this.id) { + return; + } var gfapId = this.id; var gfapLabel = $('label[for=' + gfapId + ']'); $(gfapLabel).hide();
https://www.ads-software.com/plugins/gravity-forms-auto-placeholders/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Javascript error on hidden form elements without ID’ is closed to new replies.