Hi Tuan,
Thanks for your reply.
It looks like there is some sample code — quoted below — at this page:
www.plus2net.com/javascript_tutorial/copy-data.php
At first glance it looks like all I would have to do is make note of my form field names and then plug them into the javascript code in the correct places, creating all additional lines as needed. I would replace "form1" with my form name. I would replace the field names on the left side of the equal sign with the field names in the first section of my form, and the replace the field names on the right side of the equal sign with the field names of the second section and each would match their corresponding value. I would also have to create a "Same as above" radio button field in my form — called "copy" in this example. As I mentioned in my first post, I think I'd rather just have a text link instead of a radio button, but I can work that out.
Code:
<script type="text/javascript">
function data_copy()
{
if(document.form1.copy[0].checked){
document.form1.add12.value=document.form1.add1.value;
document.form1.add22.value=document.form1.add2.value;
document.form1.city2.value=document.form1.city.value;
document.form1.state2.value=document.form1.state.value;
}else{
document.form1.add12.value="";
document.form1.add22.value="";
document.form1.city2.value="";
document.form1.state2.value="";
}
}
</script>
The question is where would I need to paste my javascript code? It looks like I'd want to put it in the main form page /components/com_pmform/views/form/tmpl/default.php
Am I on the right track?
Can I just place it at line 18 or 26? If not there, where? Please specify.
Oh, and I do understand that in my form, the fields in the second section need to be the core pmform fields for billing purposes.
Please advise,
Azurelink