You could start with something like this. If you don't understand the script, I'll be glad to help you.
Code:
<!doctype html>
<html>
<head>
<title> </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script>
//This script enables execution of javascript in the options of a selectbox
function load_script_container()
{var div_node=document.createElement('div');
div_node.setAttribute("id", "script_container");
document.body.appendChild(div_node);}
function javascript_in_selectbox(which_box) {
var optionValue=document.getElementById(which_box).options[document.getElementById(which_box).selectedIndex].value;
if (optionValue=="none") {}
else {
var script_inside_selectbox_option = document.createElement('script');
script_inside_selectbox_option.type = 'text/javascript';
script_inside_selectbox_option.text = optionValue;
while(document.getElementById("script_container").firstChild)
{document.getElementById("script_container").removeChild(document.getElementById("script_container").firstChild);}
document.getElementById("script_container").appendChild(script_inside_selectbox_option);
}
}
</script>
<body>
<div style="position: absolute; top: 10px; left: 10px; ">
<select id="your_id" onchange="javascript_in_selectbox('your_id'); selectedIndex=0" onfocus="selectedIndex=0" style="font-family: verdana; font-size: 13px; width:175px" >
<option value="none" selected >Choose a destination</option>
<option disabled>----</option>
<option value="document.getElementById('load_selected').innerHTML='<iframe src=\'http://www.dynamicdrive.com\' style=\'width: 600px; height:500px; border: 1px solid black\' frameborder=\'no\'></iframe>' ">DynamicDrive</option>
<option value="document.getElementById('load_selected').innerHTML='<iframe src=\'http://en.wikipedia.org/wiki/Main_Page\' style=\'width: 600px; height:500px; border: 1px solid black\' frameborder=\'no\'></iframe>' ">Wikipedia</option>
<option value="document.getElementById('load_selected').innerHTML='<iframe src=\'http://www.w3schools.com/\' style=\'width: 600px; height:500px; border: 1px solid black\' frameborder=\'no\'></iframe>' ">W3schools</option>
</select>
<span style="font-family: verdana; font-size: 13px; cursor: pointer" onclick="document.getElementById('load_selected').innerHTML=''">Remove</span>
<div id="load_selected"></div>
</div>
<!-- Put this script at the end of the body section -->
<script>
load_script_container()
</script>
</body>
</html>
Bookmarks