Questions about Payment Form extension

Form with two sections and link to copy info

  • azurelink
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 9 months ago #10529 by azurelink
Hi Tuan,

Is it possible to set up a Payment Form so that I can create two sections in the form, one for an Attendee's information and the second section to collect separate Billing information?

And just prior to the billing information section, to include a link that says "Click here to copy the billing information from the attendee information above?

For this client, sometimes the person paying for the registration is different that the attendee, and at other times they are the same person.

Can this be done in Payment Form?

Thanks,
azurelink

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #10537 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Form with two sections and link to copy info
Hi azurelink

We can setup the form contains two sections like you want. However, for the copy function, I am afraid of It is not possible unless you know coding and customize the extension alitle (need to add some javascript.....) .

Regards,

Tuan

Please Log in or Create an account to join the conversation.

  • azurelink
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
12 years 9 months ago #10548 by azurelink
Replied by azurelink on topic Re: Form with two sections and link to copy info
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

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc