I have a dropdown menu with the values pulled out from my sql Db.
after selecting the value, it is stored in a variable.
Lets say that i choose an option "ABC" and this is stored into the variable, i then want to use this var for opening the html file on my localhost named ABC.html
Baiscily the objectiv is redirect the user to the web page related to his choice.
here is my Script:
<html>
<head>
<script>
function getOption() {
var obj = document.getElementById("choosedOP");
document.getElementById("demo").innerHTML =
obj.options[obj.selectedIndex].text;
}
</script>
<title>ComboBox Ajax, PHP y MySQL</title>
<script src="includes/js.js"></script>
</head>
<body onload="getOp1();">
<div id="op1"></div> <br />
<div id="op2"></div> <br />
<div id="op3"></div>
<input type="button" onclick="getOption()" value="Click Me!">
</form>
<p id="demo"></p>
</body>
</html>
When i click the submit button it retrieves the selected option. How can i make it to redirect to any html select by the user?