Skip to content

Instantly share code, notes, and snippets.

@Sammyjo20
Last active September 24, 2020 08:56
Show Gist options
  • Save Sammyjo20/9d70f50dd92004ed946cf99aa6768da2 to your computer and use it in GitHub Desktop.
Save Sammyjo20/9d70f50dd92004ed946cf99aa6768da2 to your computer and use it in GitHub Desktop.
Quotehaven Javascript API - Autofilling forms
document.addEventListener('QuotehavenReady', () => {
window.quotehavenApi.populateForm({
client_one: {
title: 'mr', // mr, mrs, miss, ms, dr
first_name: 'John',
last_name: 'Doe',
smoker: false,
sex: 'male',
date_of_birth: '02/11/1980', // d/m/Y
email: 'john@codepotato.co.uk',
phone: '02392006355',
},
client_two: {
title: 'mrs', // mr, mrs, miss, ms, dr
first_name: 'Jane',
last_name: 'Doe',
smoker: false,
sex: 'female',
date_of_birth: '01/12/1970', // d/m/Y
},
is_joint: true,
years: 15,
benefit: 50000,
include_cic: false,
cic_amount: 0
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment