Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$(document).on('knack-scene-render.scene_93', function(event, scene) {
// add link
$('#view_156 ul').append('<li><a href="#" id="webmerge">Confirm Cover</a></li>');
// link hander: send to webmerge
$('#webmerge').click(function(event) {
event.preventDefault();
// get data
var data = Knack.models['view_150'].toJSON();
log('data!');log(data);
Knack.showSpinner();
$.ajax({
url: 'https://www.webmerge.me/merge/11581/zypakw',
data: {
ContactName: data.field_96_raw[0].identifier
, CorresAddress: data.field_2
, Contact: data.field_96_raw[0].identifier
, PolicyHolder: data.field_4
, PolTypeDesc: data.field_44_raw[0].identifier
, Insurer: data.field_17_raw[0].identifier
, inceptiondate: data.field_5
, ExecName: data.field_97_raw[0].identifier
, ExecPosition: data.field_194
, ExecDD: data.field_145
, ExecMob: data.field_146
, ExecMail: data.field_72_raw.email
},
type: 'POST',
success: function() {
Knack.hideSpinner();
}
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.