Temporarily added test form to top of page to demo how to use AJAX custom fields...
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 15 Dec 2017 16:05:45 +0000 (11:05 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 15 Dec 2017 16:05:45 +0000 (11:05 -0500)
views/front/registrations/registration.html

index 4b73077..3abc64a 100644 (file)
@@ -2,6 +2,44 @@
 {* Underscore Templates for the Event Registration App *}
 {* Template for Logged in Account *}
 
+<!-- *** TESTING ONLY *** -->
+<div id="test-form-request" class="button map-button">*** TEST FORM REQUEST ***</div>
+<div id="test-form-container">Test Form Container</div>
+<script type="text/javascript">
+jQuery(document).ready(function($) {
+
+    // Submit test form request
+    $('#test-form-request').click( function() {
+
+        // Collect the new field data
+        var formData = {
+            'action':       'glm_members_admin_ajax',
+            'glm_action':   'customFieldsFront',
+            'option':       'displayForm',
+            'fid':          'glm_reg_customfields_reg_event_61',
+            'recordId':     '123',
+            'parentFormId': 'abc-123',
+            'formData':     false
+        };
+
+        // Submit new field data - expect field new ID back
+        $.ajax({
+            type:       'POST',
+            url:        '{$ajaxUrl}',
+            data:       formData,
+            encode:     true,
+            dataType:   'text'
+        })
+        .done( function(formHtml) {
+            $('#test-form-container').html(formHtml);
+        });
+        
+    });
+
+});
+</script>
+<!-- *** END OF TESTING *** -->
+
 <script src="//maps.googleapis.com/maps/api/js?sensor=true&key={$settings.google_maps_api_key}"></script>
 {literal}
 <script type="text/template" id="account-template">