Sev wrote:
Website: www.flywessex.blogspot.com
You can see from the page source what an effin' mess I'm making of the
site. Aside from all the obvious alignment issues, I can't get the code
to link to the web pages within the pop up boxes. They did a minute
ago, and now I've been editing the template, they don't.
Sorry if I have not supplied enough information - but I know nothing.
Anything I've done has been from searching google and copying code.
Please help.
Hi Sev,
:) Fortunately your problem is very easy to fix.
Below is a snippet of javascript and html from your site:
<form name = "INTERVIEWS">
<select name="site" size=1>
<option value="">Click to select</option>
<option value="http://some page.html">text
</select><br><br>
<input type=button value="Go!" onClick="javascript
:formHandler(this)">
</form>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function formHandler(form){
var URL =
document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
Sev, here is a more "correct" way of doing it. For your forms write
them out like so:
<form name = "abc" onSubmit = "return formHandler(this)">
<select name = "site" size = "1">
<option value = "http://value1">text 1</option>
<option value = "http://value2">text 2</option>
</select>
<input type = "submit" value = "Go!">
</form>
For your javascript portion, it would be better if you moved it into
the <head></head> section of your html, and rewritten like so:
<script language = "javascript" type = "text/javascript">
<!--
function formHandler(myForm)
{
var URL = myForm.site.options[myForm.site.selectedIndex].value;
window.location.href = URL;
return false;
}
//-->
</script>
The problem with your current script is you have your input button call
formHandler with "this". But "this" is really a reference to the input
button, and not the form that you were hoping for. Hope this helps. :)