I need some help. I need a form with two select tags, one 'category' and one 'subcategory' where the subcategory change depending on the main category.
I have tried lots of things but can't get it working.. My latest attempt was to create seperate html-pages with just the options in them and to use the PHP include() to add the different subcategories via onChange. I was obviously unsuccessful.
<form method="post" action="search.php">
<option value="">Välj en kategori</option>
Contents of cat1.html
var i = catItem.selectedIndex;
if(i > 0)
var value = catItem.options[i].value;
if(value == "cat1")
else if(value == "cat2")
Would this method work at all? I've searched a lot on the subject and learnt that most recommend using AJAX to do this, but I barely know anything about JS so it would take too long to learn how to do that on my own; my deadline is Monday..
Please help me