// JavaScript Document function formInput(form, input) { if(input.id === "input-installed-cost" || input.id === "input-variations-cost" || input.id === "input-options-cost" || input.id === "input-solar-credits-cost") { var installedCost = document.getElementById('input-installed-cost').value != "" ? numbersOnly(document.getElementById('input-installed-cost').value) : "0"; var Variations = document.getElementById('input-variations-cost').value != "" ? numbersOnly(document.getElementById('input-variations-cost').value) : "0"; var Options = document.getElementById('input-options-cost').value != "" ? numbersOnly(document.getElementById('input-options-cost').value) : "0"; var solarCredits = document.getElementById('input-solar-credits-cost').value != "" ? numbersOnly(document.getElementById('input-solar-credits-cost').value) : "0"; var Total = document.getElementById('input-system-total-cost').value != "" ? numbersOnly(document.getElementById('input-system-total-cost').value) : "0"; Total = ((Number(installedCost) + Number(Variations) + Number(Options)) - Number(solarCredits)); if(document.getElementById('input-installed-cost')) { document.getElementById('input-installed-cost').value = installedCost; } if(document.getElementById('input-variations-cost')) { document.getElementById('input-variations-cost').value = Variations; } if(document.getElementById('input-options-cost')) { document.getElementById('input-options-cost').value = Options; } if(document.getElementById('input-solar-credits-cost')) { document.getElementById('input-solar-credits-cost').value = solarCredits; } if(document.getElementById('input-system-total-cost')) { document.getElementById('input-system-total-cost').value = Total; } } if(input.id === "input-system-total-cost") { input.value = numbersOnly(input.value); } if(input.id === "input-company-abn" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-acn" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-smart-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-telephone-countrycode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-telephone-areacode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-telephone-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-fax-countrycode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-fax-areacode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-company-fax-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-countrycode-home" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-areacode-home" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-number-home" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-fax-countrycode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-fax-areacode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-fax-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-countrycode-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-areacode-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-number-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-telephone-extension-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-primary-contact-mobile-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-countrycode-home" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-areacode-home" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-number-home" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-fax-countrycode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-fax-areacode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-fax-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-countrycode-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-areacode-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-number-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-telephone-extension-work" ) { input.value = numbersOnly(input.value); } if(input.id === "input-secondary-contact-mobile-number" ) { input.value = numbersOnly(input.value); } if(input.id === "input-address-postcode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-post-office-postcode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-government-post-office-postcode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-locked-bag-postcode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-mailing-address-postcode" ) { input.value = numbersOnly(input.value); } if(input.id === "input-account-annual-power-use" ) { input.value = numbersOnly(input.value); } if(input.id === "input-account-annual-power-cost" ) { input.value = numbersOnly(input.value); } if(input.id === "input-system-size" ) { input.value = floatOnly(input.value); } if(input.id === "input-system-budget" ) { input.value = numbersOnly(input.value); } if(input.id === "input-amount-deposited" ) { input.value = numbersOnly(input.value); } if(input.id === "input-amount-paid" ) { input.value = numbersOnly(input.value); } } function xformInput(type) { if(type === "QUOTE_TOTAL") { var installedCost, Variations, Options, solarCredits, Total; if(document.getElementById('input-installed-cost')) { if(isNaN(document.getElementById('input-installed-cost').value)) { document.getElementById('input-installed-cost').value = Number(0.00); } else { installedCost = document.getElementById('input-installed-cost').value; } } if(document.getElementById('input-variations-cost')) { if(isNaN(document.getElementById('input-variations-cost').value)) { document.getElementById('input-variations-cost').value = Number(0.00); } else { Variations = document.getElementById('input-variations-cost').value; } } if(document.getElementById('input-options-cost')) { if(isNaN(document.getElementById('input-options-cost').value)) { document.getElementById('input-options-cost').value = Number(0.00); } else { Options = document.getElementById('input-options-cost').value; } } if(document.getElementById('input-solar-credits-cost')) { if(isNaN(document.getElementById('input-solar-credits-cost').value)) { document.getElementById('input-solar-credits-cost').value = Number(0.00); } else { solarCredits = document.getElementById('input-solar-credits-cost').value; } } if(document.getElementById('input-system-total-cost')) { Total = ((Number(installedCost) + Number(Variations) + Number(Options)) - Number(solarCredits)); if(isNaN(Total)) { document.getElementById('input-system-total-cost').value = Number(0.00); } else { document.getElementById('input-system-total-cost').value = Number(Math.round(Total)); } } } if(type === "DECIMAL") { } }