[Javascript] silly question

Shaun Chatterton shaun at evolutioninteractive.co.uk
Thu Jul 19 10:20:29 CDT 2001


Can anyone tell me what is wrong with the following snippet of code
It is designed to allow the user to choose which url the contents of his
form is sent to for processing.

I keep getting errors suggesting I have a ";" missing, but I haven't a clue
where it's supposed to be.

Any help greatly appreciated.

<HTML>
<HEAD>
<SCRIPT Language=JavaScript>

function whereto(option) {
	If (option == "output1"){varOutput = "www.ibm.com";}
	If (option == "output2"){varOutput = "www.zeppotron.com";}
	return varOutput;
	}


</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD="post" ACTION= varOutput >
<INPUT TYPE="text" name="field">
</FORM>
<A HREF="#" onClick="whereto('output1');">Click here to send field to
IBM</A>
<BR><BR>
<A HREF="#" onClick="whereto('output2');">Click here to send field to the
Guardian</A>
</BODY>
</HTML>

Shaun Chatterton
Evolution Interactive
Tel 0113 394 4220




More information about the Javascript mailing list