Wasn't sure is this was the right forum to post this in as it couldbe considered as either JavaScript or HTML really.
I'm creating an online ordering page using PHP, however there are a number of types of equipment that need to be order, in the case of three of them (laptop, mobile, printer) additional fields need to be displayed. So what I want to do is have a drop down list where the user selects the type of equipment and if they click on Laptop it redirects them to a page that has the same form but with all the laptop ordering extra fields as well. This will all be done as part of one file. Basically the PHP code to determine the laptop order page is:
<?php
if ($_GET['type'] == 'laptop') {
echo "<p>This is the laptop page.</p>";
}
?>
What I've tried for the drop down list is this:
<select name="type" id="type" />
<option value="Standard PC" selected="selected">Standard PC</option>
<option value="Laptop" onClick="window.location('index.php?id=order&type=laptop');">Laptop</option>
</select>
But this isn't working. I could do this by entering the URL into the value attribute of the option tag, and then have the onchange event handler in the select tag, however i need to keep the value tags as plain text as this is needed by the rest of the PHP script. Also not all the options of the drop down list will redirect, of the ten or so options that will be in the list only three should redirect to specific pages. Can anyone think of a way i could have only those three options redirect to their individual pages when they're clicked on?
Any help with this would be great.
Cheers.
Nevermind I've figured it out now.