|
Answer» I am looking for something like this:
Visitors to my site should be able to search within a clickable list of locations (for local weather report).
Ideally, there should be a match mechanism:
as the visitor begins entering the name of the location, that name should be suggested automatically in the search field.
Is there any code like that? There are feeds out there that you can tie into your site for weather info and have it fit the formatting of your pages. Auto populating text fields can be achieved a few ways where you start typing and as you type info it is CONSTANTLY suggesting the next best match, however its a pretty involved project. The easiest method would be a simple onsubmit that TAKES say a zip code or city and state or city and country to match to for weather without the autopopulating next suggested location to run with without having to type in all the info.
The closest I have worked on such a project was with C# which fetched information off of live feeds to populate a custom browser. I haven't gone the route that you are going yet with a web server and webpage to perform all the advanced actions to help much. But maybe someone else here has to suggest some code examples which LIKELY use PHP, however it could also be done in Javascript although it would be a large script to account for all locations and have the IF this location THEN use this URL path to that feed etc and while PHP can be dynamic to change on the fly, I am unsure as to if Javascript can perform a dynamic onsubmit where it suggests the next best location based on what is typed on the fly. All the work I have done with Javascript used submit buttons to PASS form data etc or perform mouse over routines etc or read in local user info such as date, time, etc, and had some sort of spiffy effect that DIDNT involve any user intervention to process.
|