You are viewing limited content. For full access, please sign in.

Question

Question

Adding Variable Parameters onto the URL

asked on January 28, 2015

I'm passing information from one form to another by adding variable parameters onto the URL for the second form in order to auto-fill in some of the fields. It works great, except when one of the pre-filled fields has an ampersand (&) in it. Any suggestions how to correct/bypass this problem?

 

Thanks,

 

Preston

1 0

Replies

replied on January 29, 2015

If you want to encode special characters, I would suggest using one more field and do the encoding on submission form by JavaScript.

For example, field 1 in form 1 will be passsed to field A in form 2, then you can add a field 2 in form 1, set it hidden, and use JavaScript like this:

$(document).ready(function(){
        $('#q1 input').change(function(){
            $('#q2 input').val(encodeURIComponent($(this).val()));
        });
    });

Then in email service, use token for field 2 instead of field1, so the URL in email will be encoded.

I tested passing value between single line fields. Let me know whether it works for you.

2 0
replied on January 30, 2015

This worked perfectly! I have a follow-up question now. How do I pass an address from form 1 to form 2, while maintaining the address format? I can populate it into a single line using commas, but I would like to keep the clean preset Laserfiche Address format.

0 0
replied on February 2, 2015 Show version history

Unfortunately address field doesn't accept value passed through URL, so to fill an address field, you have to manually fill it, or use JavaScript to fill each input of address field.

That is, in form 1 watch change on each input of address field and set 6 variables. Pass 6 variables to 6 fields in form 2 and fill address field using JavaScript like this:

$(document).ready(function(){
	$('#q7 .Address1').val($('#q1 input').val());
    });

You can refer to http://www.laserfiche.com/support/webhelp/laserficheforms/9.2/en-us/forms/#Forms/FormFields/Address.htm for finding input boxes of address field.

 

 

0 0
replied on January 28, 2015

I'm not sure what your process is for generating the URL, but special characters like & need to be URL encoded. If you provide some additional information about how you are generating the URL, maybe someone can offer suggestions as to how to URL encode the parameters.

0 0
replied on January 28, 2015

My first form is for potential customers to fill out with their trade references and their respective emails included. I send the second email which has a credit reference request form attached. I'm pulling the customer applying for term's name and address and auto filling it into the credit reference form that is being emailed. So my question I guess is: How do I URL encode special characters if they're being pulled from a token gathered from a form?

0 0
replied on December 14, 2021

Anyone ever figure out how to pass variables to a URL when the variable contains the & symbol? That symbol separates the variables so it is throwing me off. Thanks!

0 0
replied on December 14, 2021

Have you tried using %26 as recommended by this website https://www.w3schools.com/tags/ref_urlencode.asp ?

1 0
replied on December 14, 2021

that did it! thanks so much

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.