Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do i get web pages to fill form feild

Featured Replies

It would be possible with PHP. If you sent a GET value of the trade in the linked URL then on the form page the PHP script could read the GET and fill the field with the value.

  • Author
It would be possible with PHP. If you sent a GET value of the trade in the linked URL then on the form page the PHP script could read the GET and fill the field with the value.

 

Could someone give me an axample of how the code relating to this would look, on both the pages. I understand what you mean but i have no idea how to do it.

Could someone give me an axample of how the code relating to this would look, on both the pages. I understand what you mean but i have no idea how to do it.

 

Sure, you need to update the inward links to include the get variable:

http://www.elitetradesmen.com/searchtrades.html?trade=Alarm%20Specialist

This will send the GET veriable 'trade' with the value 'Alarm Specialist'. The %20 in the a space encodeing.

 

In the form for need to add the value parameter to the text field and then use PHP to print the GET to the HTML:

 

<input type="text" name="FirstName2" value="<?php echo $_GET["trade"]; ?>" />

 

The searchtrades.html page will have to either be renamed to .php or use htaccess to parse it as a PHP file.

 

Hope that helps.

Hi speed,

 

This is a very basic way of doing it, but it should work fine.

 

Link:

<a href="http://www.elitetradesmen.com/searchtrades.php?trade=Alarm%20Specialist">Book me an alarm specialist</a>

Form:

(Ammend your trade input box with this:)
<input type="text" name="FirstName2" value="<?PHP echo $_GET['trade']; ?>" />

I noticed that your form page is a .html document, you'll need to make this a .php else the PHP code won't work.

 

Hope this helps.

Ahh oops. Good answer though Microfrost ;)

Ahh oops. Good answer though Microfrost ;)

I was jus thinking the same back. Thought you copied me for a second :p

  • Author

I understood that till you said to change the page to PHP? I'm sorry, this is my first attempt at a web site so its all new to me. If there is an easy way to change to php, i will do a search later but i never seem to be able to find anything which explains it well enough for me to understand at the moment.

You just need to rename the file to .php rather than .html. And of course then update all the links to address it.

Just change the file extension from .html to .php

Haha oh dear..

  • Author

Cheers, didn't expect it to be that simple. Must be frustrating for you guys but just want to say that even simple advice like that is really appreciated.

It's not frustrating at all! We all have to start somewhere.

 

The "Oh dear" comment was because Microfrost and I kept double posting, not because you hadn't understood.

Once apon a time I didn't know what a index file was and linked to my homepage as someusername.freeserve.co.uk/homepage.html. :o

  • Author

Ok i've done something wrong. I'm getting a value appear in the text box but not the right one. Can someone tell me what i've done wrong.

Ok i've done something wrong. I'm getting a value appear in the text box but not the right one. Can someone tell me what i've done wrong.

 

 

you've simply put the

<?PHP echo $_GET['trade']; ?>

 

Into the wrong text field.

 

 

try changing it to a different text field untill you get the right one.

 

Hope this helps.

 

Ben

Ok i've done something wrong. I'm getting a value appear in the text box but not the right one. Can someone tell me what i've done wrong.

If you're still having problems tomorrow drop me an email on tom[at]tombeynon.co.uk and I'll help you sort it out :)

 

I'd do it tonight but the pub calls...

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.