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


#1

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…


#2

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


#3

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


#4

Hi @navjot789!

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


#5

Yes sir this what is want sir.


#6

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


#7

Or you can change the file extension to .php.


#8

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


#9

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


#10

sir but i want in javascript only


#11

Replace the forn method with GET instead of POST


#12

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: