I am trying to find out how I can make a program in JavaScript/HTML that takes a user's input and automatically enters this information onto a different web page. I am new to JavaScript/HTML so any help would be appreciated!
-
2This is too broad. Can you be more specific? What have you accomplished so far? – Roysh Dec 03 '17 at 11:44
-
Possible duplicate of [Passing Variable through JavaScript from one html page to another page](https://stackoverflow.com/questions/27765666/passing-variable-through-javascript-from-one-html-page-to-another-page) – Grim Reaper Dec 03 '17 at 11:51
-
I have made 7 input text boxes and when a button is clicked a function stores them as variables – Jackwazzup Dec 03 '17 at 11:57
2 Answers
You specified the website as:
Supreme
Now, when you go to checkout, right click and click Inspect Elements. Then find all of the input fields on the website. For example, I found the Full Name input field. The field has a name: order[billing_name]
What you want to do next is in your URL do something like this:
https://www.supremenewyork.com/checkout?order[billing_name]=yourname
Now if you want multiple values (most likely) you need to find the names of the other fields and add the values to the URL, as so:
https://www.supremenewyork.com/checkout?order[billing_name]=yourname&order[email]=youremail
This way you can pass the values from your application and fill in the form on that website. Hope this helps.

- 561
- 4
- 6
- 22
-
Can i load them up on any page on the internet so if its not my page. Since I am trying to auto fill a website. – Jackwazzup Dec 03 '17 at 11:59
-
Ah, I see. It depends on the way that website receives information. If the website uses Query strings (such as ?name=user) then you can just load the URL and pass in the values inside the URL. If the website uses something like Ajax of some sort, it will not be that simple. – Grim Reaper Dec 03 '17 at 12:02
-
Ok how can i find out if the website uses query strings or ajax? or is it not that simple. Btw thanks for quick responses – Jackwazzup Dec 03 '17 at 12:06
-
Go to the website, and mess around with it. Find a form and try to submit it. Keep track of the URL. If '?' appears in it, you may be able to pass values this way. I can't say for sure since it depends on the website. Would you mind providing the link? – Grim Reaper Dec 03 '17 at 12:08
-
Yes I am trying to make an autofill so that my friend can buy things faster for example this shop here: https://www.supremenewyork.com/checkout he would like to fill out all the information there. – Jackwazzup Dec 03 '17 at 12:10
-
-
Ok i will go and mess around. Do you think this is very complicated or is it fairly simple. I just want to know if I am a bit out of my depth here. – Jackwazzup Dec 03 '17 at 12:24
-
This is as easy as it gets. You just add things to the URL. Following my post should solve your problem. If you feel this answered your question feel free to accept my post as a valid answer. – Grim Reaper Dec 03 '17 at 12:26
-
Just one more question. So you say in order for this to work i just need to add things to the url of the website. Do I have to do this manually or can I make the programme do it for me. – Jackwazzup Dec 03 '17 at 12:29
-
You can make a simple program like this: `window.location.replace(https://www.supremenewyork.com/checkout?order[billing_name]=${yourNameVariable}&order[email]=${yourEmailVariable});` and you can just keep adding things to this using '&' as I did in this example. – Grim Reaper Dec 03 '17 at 12:32
-
Ok thank you so much for your help. I really appreciate it! Thanks for putting up with me since I am not that good at javascript yet! Thanks! – Jackwazzup Dec 03 '17 at 12:34
-
No problem :) Everyone was a beginner at first. Good luck with your program! (also, tick the answer as accepted if this helped you :) ) – Grim Reaper Dec 03 '17 at 12:35
Use localstorage. see working demo in the link below;
Note: localStorage won't work in snippet; hence I made a fiddle.

- 1,225
- 2
- 10
- 20