From 6de68c8671d4fa691cd17a815ea0ab0f3adb08aa Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Fri, 1 Nov 2019 09:51:32 +0530 Subject: [PATCH] avoid repetition on get_form date --- erpnext/www/book-appointment/index.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/erpnext/www/book-appointment/index.js b/erpnext/www/book-appointment/index.js index 19fc704501..6bd868bbc7 100644 --- a/erpnext/www/book-appointment/index.js +++ b/erpnext/www/book-appointment/index.js @@ -208,10 +208,7 @@ async function submit() { function get_form_data() { contact = {}; - contact.name = document.getElementById('customer_name').value; - contact.number = document.getElementById('customer_number').value; - contact.skype = document.getElementById('customer_skype').value; - contact.notes = document.getElementById('customer_notes').value; - contact.email = document.getElementById('customer_email').value; + let inputs = ['name', 'skype', 'number', 'notes', 'email']; + inputs.forEach((id) => contact[id] = document.getElementById(`customer_${id}`).value) window.contact = contact }