Hi Guys,
I am taking billing & shipping information on a single form. The billing information comes first, then there is a checkbox asking whether billing and shipping information is the same, and the shipping information fields follow that.
I need the billing information values the user types to copy into the shipping information field values. I have tried to do this with Javascript and it works when not in Chrono forms, however when I go back into Chronoforms and try to implement it their, it doesn't work. In fact, any Javascript I place into the "Form JavaScript" section doesn't even appear on the pages source code when I refresh and view the page source.
To make a long story short, I bypassed the "Form Javascript" section in the chronoforms backend and just added the javascript to the "head" section of my index.php file. Here is the code:
When I click the checkbox on my page I get a javascript error in Firebug that states:
"Error: document.ChronoContact_orderform.copy is undefined"
Any ideas?
I am taking billing & shipping information on a single form. The billing information comes first, then there is a checkbox asking whether billing and shipping information is the same, and the shipping information fields follow that.
I need the billing information values the user types to copy into the shipping information field values. I have tried to do this with Javascript and it works when not in Chrono forms, however when I go back into Chronoforms and try to implement it their, it doesn't work. In fact, any Javascript I place into the "Form JavaScript" section doesn't even appear on the pages source code when I refresh and view the page source.
To make a long story short, I bypassed the "Form Javascript" section in the chronoforms backend and just added the javascript to the "head" section of my index.php file. Here is the code:
<script type="text/javascript">
var ChronoContact_orderform="ChronoContact_orderform";
function data_copy()
{
if(document.ChronoContact_orderform.copy[0].checked){
document.ChronoContact_orderform.shipping_address.value=document.ChronoContact_orderform.billing_address.value;
document.ChronoContact_orderform.shipping_address2.value=document.ChronoContact_orderform.billing_address_2.value;
document.ChronoContact_orderform.shipping_city.value=document.ChronoContact_orderform.billing_city.value;
document.ChronoContact_orderform.shippingstate.value=document.ChronoContact_orderform.billing_state.value;
document.ChronoContact_orderform.shippingzip.value=document.ChronoContact_orderform.billing_zip.value;
document.ChronoContact_orderform.shipping_country.value=document.ChronoContact_orderform.billing_country.value;
}else{
document.ChronoContact_orderform.shipping_address.value="";
document.ChronoContact_orderform.shipping_address2.value="";
document.ChronoContact_orderform.shipping_city.value="";
document.ChronoContact_orderform.shippingstate.value="";
document.ChronoContact_orderform.shippingzip.value="";
document.ChronoContact_orderform.shipping_country.value="";
}
}
When I click the checkbox on my page I get a javascript error in Firebug that states:
"Error: document.ChronoContact_orderform.copy is undefined"
Any ideas?