Posted by Toby Inkster on 02/25/06 11:03
ken wrote:
> <SCRIPT LANGUAGE="JavaScript">
The "language" attribute has been obsolete for quote some time. Use:
<script type="text/javascript">
> function formHandler(form){
> var URL =document.form.site.options[document.form.site.selectedIndex].value;
> window.location.href = URL;}
Nasty. Use:
function formHandler ()
{
var sel = document.getElementById('site');
var url = site.options[site.selectedIndex].value;
window.localtion.href = url;
}
> </script>
>
> <form name="form">
> <select name="site" size=1 onChange="javascript:formHandler2()">
Replace these two with:
<form action="redirect.php" method="GET">
<div>
<select name="site" id="site" onchange="formHandler();">
> <option value="">Enrollment, Fees, Policies
> <option value="enrollment.html">Enrollment
> <option value="ssh_policies.html">School Policies & Fees
"&" here should be replaced with "&".
> <option value="schedule.html">Group Class Schedule
> </select>
Now add:
<noscript>
<input type="submit" value="Go">
</noscript>
</div>
</form>
And create "redirect.php" to handle those visitors who have Javascript
disabled. Here's a basic "redirect.php".
<?php
$url = $_GET['site'];
if (!preg_match('#http://#', $url))
$url = "http://{$_SERVER['HTTP_HOST']}/{$url}";
header("Location: $url");
?>
It assumes that your host supports PHP.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|