0

Im trying to use onclick to send data from a simple form via a url to fill in a signup form.

onclick="window.open('http://url.com/signup/{name:value}/{email:value}');"

It does not include the data in the url but send it as is. Is there a step im missing to get the data from the form

1 Answer 1

0

The replacement of tags, in your case {name:value} & {email:value}, does not occur until after the Form has been submitted.

At the point of clicking on a Field in the Form the tags are just a string characters as you see them and that is what gets passed to the new window.

If you want the values in the fields to be passed at the click of a field/button then you will need include some Javascript in the Forms Properties tab that extracts the values from the fields and opens the new sign up page. Your onclick would then look something like

onclick="mysignup()"

And in your Javascript you would have something like (provided as is, not tested)

function mysignup(){
var name = document.getElementById('name_field').value;
var email = document.getElementById('email_field').value;

window.open('http://url.com/signup/' + name + '/' + email);
}

If the external sign up page doesn't require a users intervention then you may be able to do the sign up as part of the PHP post submission scripts if the external site provides the capability. There are some examples of this on the RS Form forum.

2
  • Thank you your solution worked perfectly for my needs - just edited the name_field and email_field Commented Feb 7 at 6:19
  • Glad it worked for you. Please accept the answer so we can see it has been resolved.
    – Irata
    Commented Feb 7 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.