[Javascript] silly question

Rees, Mark (TWIi London) mrees at twii.net
Thu Jul 19 10:30:34 CDT 2001


Try if instead of If

Mark

-----Original Message-----
From: Shaun Chatterton [mailto:shaun at evolutioninteractive.co.uk]
Sent: 19 July 2001 16:20
To: dsaf
Subject: [Javascript] silly question


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

_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
http://www.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list