From: Laury GvR Date: Thu, 26 Oct 2017 19:54:46 +0000 (-0400) Subject: Placing required flag back into the edit form in management X-Git-Tag: v1.0.4^2~21 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=301f19b18a5bbe656aa576411a70b5e44e8d0436;p=WP-Plugins%2Fglm-member-db-fields.git Placing required flag back into the edit form in management --- diff --git a/views/admin/management/fields.html b/views/admin/management/fields.html index 1f4086e..b2f97bc 100644 --- a/views/admin/management/fields.html +++ b/views/admin/management/fields.html @@ -87,6 +87,13 @@ (text or checkbox only) + + Required? + + + + +

* Required

@@ -197,10 +204,12 @@ jQuery(document).ready(function($) { var fieldName = $(this).text(); var fieldType = $(this).attr('data-fieldType'); var adminSearch = $(this).attr('data-adminSearch'); + var required = $(this).attr('data-required'); + $('#editFieldID').val(fieldID); $('#editFieldName').val(fieldName.trim()); $('#editFieldType').val(fieldType); - console.log(adminSearch); + if (adminSearch === '1') { console.log('setting the checked to true'); $('#editAdminSearch').prop('checked', true); @@ -208,6 +217,13 @@ jQuery(document).ready(function($) { console.log('setting the checked to false'); $('#editAdminSearch').prop('checked', false); } + // check required fields + if (required === '1') { + $('#editRequired').prop('checked', true); + } else { + console.log('setting the checked to false'); + $('#editRequired').prop('checked', false); + } $("#editFieldDialog").dialog("open"); }); $('#editFieldCancel').click( function() {