General HTML/Web Design Programming Q`s/HTML search
I would like to set up a simple search on a web page. The purpose of it is for users to find out what region they are in based on the county they live in. I was thinking of two possible options. 1) a search box that the user types the county name in, hits a submit button and the region name is returned or 2) the county names are listed in a dropdown menu and when a user selects a county from the menu the appropriate region populates in a field next to it.
I don't have any idea how to begin to approach this. Any help is greatly appreciated. Thanks!
Usually a search box on a webpage is to find something/data/section that is already somewhere on the webpage.Technically speaking it is feasable but I would not recommand it as it means you have to write all information on the HTML of the page.
You second approach is the best. I would suggest a PHP request set up with a database (MySQL). This would allow you to record your visitor's choice in your database, just like his/her passwword, email, username etc.
I am not a PHP expert, but it would be fairly easy for someone with fair knowledge of the PHP language. There are websites which have PHP function codes available for free. You could adapt the code to suit your need but you need to go into a database to set it up.
Upon reflection, I believe that a search box would be possible with a PHP set up. The list of choices would then be in the database and not in the HTML itself.
Hope this help.
Good coding !