Dschrepfer Posted July 24, 2014 Report Share Posted July 24, 2014 Hello, I have been working on this code all day trying to get it to work in my form. I have a check box named "BillTo_Same" and when it is checked I want the customer address to auto fill the Bill To address. I'm not sure why this isn't working... All my ID's match the system correctly and the code is in the footer of my form. Any help would be appreciated. <script>function f_address(){if(document.getElementById('BillTo_Same').checked) { document.getElementById('InsertRecordBillToName').value=document.getElementById('InsertRecordCompany').value;document.getElementById('InsertRecordBillToAddress').value=document.getElementById('InsertRecordAddress').value;document.getElementById('InsertRecordBillToCity').value=document.getElementById('InsertRecordCity').value;document.getElementById('InsertRecordBillToState').value=document.getElementById('InsertRecordState_Province').value;document.getElementById('InsertRecordBillToZip').value=document.getElementById('InsertRecordZip_Code').value;document.getElementById('InsertRecordBillToCountry').value=document.getElementById('InsertRecordCountry').value;} else {document.getElementById('InsertRecordBillToName').value="";document.getElementById('InsertRecordBillToAddress').value="";document.getElementById('InsertRecordBillToCity').value="";document.getElementById('InsertRecordBillToState').value="";document.getElementById('InsertRecordBillToZip').value="";document.getElementById('InsertRecordBillToCountry').value="";}}document.getElementById('BillTo_Same').onclick= f_address;</script> Quote Link to comment Share on other sites More sharing options...
Dschrepfer Posted July 25, 2014 Author Report Share Posted July 25, 2014 I figured out why it wasn't working. I needed the ID for my checkbox to be 'insertRecordBillTo_Same'. The sad part is that I stared at this code all day yesterday wondering why it wouldn't work. Today I caught my error right away... jonathanr 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.