I'm having trouble making my list box links work. I found the following code on this w开发者_Go百科ebsite, but when I preview it in the browser, the link works for the fist option I choose, but if I try a second option, the browser tells me it can't find the page.
<select onchange="javascript:handleSelect(this)">
<option value="../Pages/Examples of Business plans/Business plan samples">Agriculture</option>
<option value="../Pages/Examples of Business plans/Business plan samples">Automotive</option>
<option value="../Pages/Examples of Business plans/Business plan samples">Hospitality</option>
</select>
<script type="text/javascript">
function handleSelect(elm)
{
window.location = elm.value+".php";
}
</script>
The file does not exist in that directory.
i.e. There is no file named 'value of the elm
control' with '.php' appended to it in the directory of the code you are using there.
精彩评论