Also adding form tag around where the custom field will go.
this.$el.html( this.template( this.model.toJSON() ) );
this.$emailInput = this.$('.editEmail');
this.$('.reg-edit-form').hide();
+ this.setCustomFieldsForm();
return this;
},
this.remove();
},
+ setCustomFieldsForm: function(){
+ var formData = {
+ 'action': 'glm_members_admin_ajax',
+ 'glm_action': 'customFieldsFront',
+ 'option': 'displayForm',
+ 'fid': 'glm_reg_customfields_reg_event_attendee_' + this.model.get('reg_event'),
+ 'recordId': '1',
+ 'parentFormId': 'abc-123',
+ 'formData': false
+ };
+ $.ajax({
+ type: 'POST',
+ url: ajaxUrl,
+ data: formData,
+ encode: true,
+ dataType: 'text'
+ })
+ .done( function( formHtml ) {
+ $('.attendee-cf').html( formHtml );
+ });
+ },
});
// js/views/front/regTime.js
this.$el.html( this.template( this.model.toJSON() ) );
this.$emailInput = this.$('.editEmail');
this.$('.reg-edit-form').hide();
+ this.setCustomFieldsForm();
return this;
},
this.remove();
},
+ setCustomFieldsForm: function(){
+ var formData = {
+ 'action': 'glm_members_admin_ajax',
+ 'glm_action': 'customFieldsFront',
+ 'option': 'displayForm',
+ 'fid': 'glm_reg_customfields_reg_event_attendee_' + this.model.get('reg_event'),
+ 'recordId': '1',
+ 'parentFormId': 'abc-123',
+ 'formData': false
+ };
+ $.ajax({
+ type: 'POST',
+ url: ajaxUrl,
+ data: formData,
+ encode: true,
+ dataType: 'text'
+ })
+ .done( function( formHtml ) {
+ $('.attendee-cf').html( formHtml );
+ });
+ },
});
<div class="columns large-4 small-12">Email Address</div>
<div class="columns large-8 small-12"><input class="add_reg_email" value="<%- email %>"></div>
</div>
- <div class="attendee-cf"></div>
+ <form class="attendee-cf-form"><div class="attendee-cf"></div></form>
<div>
<a class="show-hide-address">Address (show/hide)</a>
</div>
<div class="columns large-4 small-12">Email Address</div>
<div class="columns large-8 small-12"><input class="reg_email" value="<%- email %>"></div>
</div>
+ <form class="attendee-cf-form"><div class="attendee-cf"></div></form>
<div>
<a class="show-hide-address">Address (show/hide)</a>
</div>
{$reg_bulletin}
</div>
{/if}
-
+
<div class="row">
<div id="regApp" class="columns small-12">
</div>