I have a web form in, say ‘page2’ of my website.
To get to the web form, I have a link on ‘page1’ of the site.
ie: <a href=“page2” title=“Click for contact form”>link to form</a>
There are going to be many links on page 1 to the same form.
How can I pass or insert a value into one of the form fields (on page 2) so that when the form loads, one of the fields is already complete with a value determined by the previous page?
ie: the ‘reference’ field in my form on page 2, would already by complete when you click through to it. The value of the reference field is determined by which link you click through on, from page 1.
Im hoping there is something I can add to the a href on page 1, to pass this data across?
You can add query parameters to the link, but you’ll need a server-side script or program to generate the form for you. It’s not something you can do with pure HTML, which is a markup language, not a programming language.
Thanks for your reply - where can I find out more about this script thing I need then? If i get one will that make the link you posted work? (and does ‘page2’ not need the /html on the end?
A much used server side scripting language is PHP.
Try googling for ‘php form tutorial’ and you’ll get lots of tutorials and examples. All you have to do now is study…
Did you try googling what I said? The first result is (I quote)
PHP form introduction. A complete article how to use forms in PHP.
I guess that’s what you need, isn’t it. Learning how to use forms in PHP. Just give it a shot. And if you get stuck at some point, don’t hesitate to come back and ask your questions.
Ive read a lot about using PHP in forms, but that type of tutorial or info is too broad. I want to research about specifically what im wanting to do. Not a begginers guide to PHP, you know?
Is what im wanting to do known as “passing a value from a link into a field” or… i dont even know, but there must be some ‘term’ or name for this function or whatever