Created
November 21, 2012 20:22
-
-
Save qbmarketing/4127411 to your computer and use it in GitHub Desktop.
copying fields in my form
This file contains hidden or 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
Taking your advice to do it in jQuery, this is what I NOW have above the form: | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
$("input#same").click(function(){ | |
if ($("input#same").is(':checked')) | |
{ | |
// Checked, copy values | |
$("input#first_name").val($("input#order_first_name").val()); | |
$("input#last_name").val($("input#order_last_name").val()); | |
} | |
else | |
{ | |
// Clear on uncheck | |
$("input#first_name").val(""); | |
$("input#last_name").val(""); | |
} | |
}); | |
}); | |
</script> | |
And then the checkbox is: | |
<input type="checkbox" id="same"> | |
But it's still not working for me. Stumped. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment