0

Hi I was wondering if someone could help me with a code for my website? Basically what I want to do is have a drop down list that is essentially a matrix in the sense that picking one option leads to another and eventually you can narrow down the results and find what you're looking for.

for example if i was searching for cars:

what type of car: honda, ford, etc
what colour: red, blue, green etc
what year: 1999,2000 etc
price: under 5000, etc

and eventually these choices would lead to different results based on what the users input was. If I am posting in the wrong section I am sorry as I am new here and this seemed a good fit...thanks I appreciate any help I can get as I am a novice who has a website!

6
Contributors
7
Replies
8
Views
7 Years
Discussion Span
Last Post by kar123
0

You have to use javascript, php, mysql and ajax. What level you having knowledge on those parts and try to show your code what you have tried?

0

You also may use Flash which gives you a simple manner of doing it!
There's also many web sites which automatically create HTML menus for you. It's simple to find it, just google it.

0

thank you both for replying, I was wondering if that is what it is called - HTML menu? Then I believe I can google search it and find a quick template to add onto my website.

0

If none of the following options are dependent of the choice of the former one then you don't need JavaScript, you can simply have several dropdownlists :)

<select name="make">
   <option value="ford">Ford</option>
   <option value="volvo">Volvo</option>
   <option value="saab">Saab</option>
</select>
<select name="colour">
   <option value="red">Red</option>
   <option value="green">Green</option>
   <option value="blue">Blue</option>
</select>
<select name="year">
   <option value="1990">1990</option>
   <option value="1989">1989</option>
   <option value="1988">1988</option>
</select>

//etc.

Check this site to learn more about the dropdownlist (html select-element):
http://www.w3schools.com/tags/tag_select.asp

Then you just use a simple php-script to get the values from these elements and load the content depending on the user's inputs.

$make = mysql_real_escape_string($_POST['make']);
$colour = mysql_real_escape_string($_POST['colour']);
$year = mysql_real_escape_string($_POST['year']);

$result = mysql_query("SELECT * FROM cars WHERE make='$make' AND colour='$colour' AND year='$year') or die(mysql_error());

I hope this was helpful!

0

You also may use Flash which gives you a simple manner of doing it!
There's also many web sites which automatically create HTML menus for you. It's simple to find it, just google it.

Yes, you're right! Whatever he is asking for I think flash can solve this problem easily. But still if anyone is not so familiar with flash design, action scripts other HTML options are also there to solve it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.