Skip to content

Commit fd96682

Browse files
committed
gpnf-sortable-entries.php: Fixed an issue with sortable entries not working correctly.
1 parent a4c8c66 commit fd96682

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gp-nested-forms/gpnf-sortable-entries.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,12 @@ public function output_script() {
237237
}
238238

239239
gform.addAction( 'gpnf_session_initialized', function(gpnf) {
240-
if ( gpnf.formId != self.formId ) {
240+
if ( self.formId && gpnf.formId != self.formId ) {
241241
return;
242242
}
243243

244-
var $form = $( '#gform_' + self.formId );
245-
var $field = $form.find( '#field_' + self.formId + '_' + self.fieldId );
244+
var $form = $( '#gform_' + gpnf.formId );
245+
var $field = $form.find( '#field_' + gpnf.formId + '_' + gpnf.fieldId );
246246
var $entries = $field.find('.gpnf-nested-entries tbody');
247247

248248
$entries.sortable({

0 commit comments

Comments
 (0)