I have a button on a form that I would like to do two things: send the form to an e-mail address and then (or at the same time) send the user to a URL. It's a registration form and I want completed for to go to one person and then the user be redirected to our unique https PayPal site to pay for registration.
There can only be one event when a button is clicked so no you do not have to put on eon top of the other. But you can hide the mail button (anywhere on the page), then on the click event of the other button programmatically click the mail button:
I guess I'm confused about where to put the event and the correct syntax, because I keep getting an error. Here is the event code for the non-hidden button. For testing, the e-mail address can be email@example.com. Can you give me the whole correct line and placement so I can learn how to do this sort of thing in the future?<br /><br /><event activity="click" name="event__click"><br /> <submit format="urlencoded" textEncoding="UTF-16" target="http://www.buckandmike.com"/> <br /> </event><br /> </field><br /> <?templateDesigner expand 1?>
You are showing a snippet of the XDP file .....you can highlight the visible button, then look in the script editor. You can choose the event that you want to code against (in the dropdown at the top right). In your case choose click. Your code should be there.
Paul, I can't choose click because this the visible button is a submit button (it has to be so it redirects to HTTP). According to the Help it must go in the preSubmit. Below is the line. I don't understand where to put the emailButton.execEvent("click") code in relation to this.