shao_khan Posted August 6, 2003 Report Share Posted August 6, 2003 I want a web site with a drop down box to select food / drink items - say Salad. Is there as easy way in Frontpage to have a drop down box, and when you select the item it gives you a list of releevnt items or do I have to write a propper database and queries? Link to comment Share on other sites More sharing options...
Colin M Posted August 6, 2003 Report Share Posted August 6, 2003 By "drop down box" do you mean "pull down menu"? If so try this example: <select NAME="SportImport" ONCHANGE="GoUrl(this)"> <option value selected>Choose Page <option value>-------------- <option value="http://www.sportimport.co.uk">Home Page <option value="http://www.sportimport.co.uk/importing.htm">Importing Audi <option value="http://www.sportimport.co.uk/s3.htm">Audi S3 <option value="http://www.sportimport.co.uk/ttc.htm">Audi TT Coupe <option value="http://www.sportimport.co.uk/ttr.htm">Audi TT Roadster <option value="http://www.sportimport.co.uk/a4.htm">Audi A4 </select> Link to comment Share on other sites More sharing options...
shao_khan Posted August 6, 2003 Author Report Share Posted August 6, 2003 Colin - that looks about right, the only problem I have is that I get an error on the first line of that piece of text telling me it was expecting an object (I'm still learning all this stuff) - any idea what it means by that? Cheers Link to comment Share on other sites More sharing options...
s4dreamer Posted August 6, 2003 Report Share Posted August 6, 2003 Colin forgot to give you the bit of JavaScript which makes it work.. <script type="text/javascript" language="JavaScript"> function GoURL(url) { // Put a // in front of this if it doesn't work this.location.href = url; // If that don't work, remove the // and try: // this.location.replace(url); } </script> I didn't test that, but Link to comment Share on other sites More sharing options...
s4dreamer Posted August 6, 2003 Report Share Posted August 6, 2003 Actually, that won't work either... hang on... Link to comment Share on other sites More sharing options...
s4dreamer Posted August 6, 2003 Report Share Posted August 6, 2003 In the header of your document: <script type="text/javascript" language="JavaScript"> function GoUrl(mylist) { this.location.replace(mylist.value); } </script> Then, in the body <select name="gotolist" onchange="GoUrl(gotolist);"> <option value="http://uk.yahoo.com" SELECTED>Yahoo! UK</option> <option value="http://www.tyresmoke.net">TyreSmoke</option> <option value="http://www.audi-sport.net>Audi-Sport.net</option> </select> Think that should do it, although I haven't tested it. Trev Link to comment Share on other sites More sharing options...
shao_khan Posted August 6, 2003 Author Report Share Posted August 6, 2003 cheers guys that works good and does just as I want to do. Link to comment Share on other sites More sharing options...
Colin M Posted August 7, 2003 Report Share Posted August 7, 2003 Oops yes, forgot the java from higher up my page that controls that new page load. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now