How to display form value in the address bar or pass it on the another page?

hi there!

I m currently stuck at the form. what I am trying to do is enter the name and email from the form and redirect the values on the another page but the point is this should be done only with JavaScript.

here is the form look:

code for this form:

     <form method="post" class="af-form-wrapper" accept-charset="UTF-8" action="https://www.aweber.com/scripts/addlead.pl" target="_blank" >
     <div style="display: none;">
     <input type="hidden" name="meta_web_form_id" value="366827005" />
     <input type="hidden" name="meta_split_id" value="" />
     <input type="hidden" name="listname" value="awlist4823096" />
     <input type="hidden" name="redirect" value="https://wanderistlife.typeform.com/to/u52pwv?name=<script type="text/javascript">formData.display("name_(awf_first)")</script>" id="redirect_4acabdbbe3825a3800648e3cae5fa1c6" />
     <input type="hidden" name="meta_redirect_onlist" value="https://wanderistlife.typeform.com/to/u52pwv?email=<script type="text/javascript">formData.display("email")</script>" />
     <input type="hidden" name="meta_adtracking" value="My_Web_Form_2" />
     <input type="hidden" name="meta_message" value="1" />
     <input type="hidden" name="meta_required" value="name,email" />

     <input type="hidden" name="meta_tooltip" value="" />
     </div>
     <div id="af-form-366827005" class="af-form"><div id="af-header-366827005" class="af-header"><div  class="bodyText"><p>&nbsp;</p></div></div>
     <div id="af-body-366827005" class="af-body af-standards">
     <div class="af-element">
     <label class="previewLabel" for="awf_field-96089735">Name: </label>
     <div class="af-textWrap">
     <input id="awf_field-96089735" type="text" name="name" class="text" value=""  onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " tabindex="500" />
     </div>
     <div class="af-clear"></div></div>
     <div class="af-element">
     <label class="previewLabel" for="awf_field-96089736">Email: </label>
     <div class="af-textWrap"><input class="text" id="awf_field-96089736" type="text" name="email" value="" tabindex="501" onfocus=" if (this.value == '') { this.value = ''; }" onblur="if (this.value == '') { this.value='';} " />
     </div><div class="af-clear"></div>
     </div>
     <div class="af-element buttonContainer">
     <input name="submit" id="af-submit-image-366827005" type="image" class="image" style="background: none; max-width: 100%;" alt="Submit Form" src="https://forms.aweber.com/images/forms/big-sale/blue/circle-submit-button.png" tabindex="502" />
     </form>

Now, when I enter the values in Name and email fields and hit the submit button I will redirect to the next page:

as you can see in this above link https://wanderistlife.typeform.com/to/u52pwv?name=<script%20type=
the javascript wasn’t work. you can check the coding in the form code above.

what i want is if I enter name=navjot in form then url bar will be contain https://wanderistlife.typeform.com/to/u52pwv?name=navjot

I know its a simple but I don’t know how to do in javascript any help is apprecheated
any help…

Hi i think you have to wait for sometime because i am not good at it :sweat_smile:

1 Like

Why do you want to do it as JavaScript if you can do it with PHP?

1 Like

Hi @navjot789!

Do you want the values to be sent to a processing form using JavaScript?

2 Likes

Yes sir this what is want sir.

Because the file i use is html formate only so no php supported in it.

Or you can change the file extension to .php.

1 Like

i agree with you but i stay with .html extension akhil sir

Well what’s the problem with .php extension if you do it then you can easily place php script inside it

1 Like

sir but i want in javascript only

Replace the forn method with GET instead of POST

I suggest you to use jQuery library to do that. Also, if you can, use POST method instead of GET (URL requests are sent over GET) when sending form data to a server. Please check out this article:

I apologize I can’t code the function myself. I am currently on mobile. Please reply the results :slight_smile:

1 Like

This topic was automatically closed after 5 days. New replies are no longer allowed.