avoid repetition on get_form date

This commit is contained in:
0Pranav
2019-11-01 09:51:32 +05:30
parent 957c9f5ff0
commit 6de68c8671

View File

@@ -208,10 +208,7 @@ async function submit() {
function get_form_data() { function get_form_data() {
contact = {}; contact = {};
contact.name = document.getElementById('customer_name').value; let inputs = ['name', 'skype', 'number', 'notes', 'email'];
contact.number = document.getElementById('customer_number').value; inputs.forEach((id) => contact[id] = document.getElementById(`customer_${id}`).value)
contact.skype = document.getElementById('customer_skype').value;
contact.notes = document.getElementById('customer_notes').value;
contact.email = document.getElementById('customer_email').value;
window.contact = contact window.contact = contact
} }