Created
August 8, 2014 10:05
-
-
Save Barrytron1983/ebd7bf15bef884231214 to your computer and use it in GitHub Desktop.
Automatically fill a form field with text from another field using checkbox :: JS/Wordpress/Contact Form 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Header: */ | |
<script type="text/javascript"> | |
function FillBilling(f) { | |
if(f.billingtoo.checked == true) { | |
f.invoice_textarea.value = f.deliveryaddress.value; | |
} | |
} | |
</script> | |
/* in the form - using Contact Form 7 */ | |
<p>Delivery Address <span style="color: #ff0000">*</span></p> | |
[textarea* textarea-572 id:deliveryaddress class:input-text] | |
<input type="checkbox" name="billingtoo" onclick="FillBilling(this.form)"> | |
<em>Check this box if Invoice Address and Delivery Address are the same.</em><br> | |
<p>Invoice Address <span style="color: #ff0000">*</span></p> | |
[textarea* textarea-252 id:invoice_textarea class:input-text] | |
<br> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment