[Javascript] silly question
Peter Brunone
peter at brunone.com
Thu Jul 19 10:28:08 CDT 2001
(1) Does the error message give you a line number?
(2) What are you trying to accomplish with return varOutput ? If you want to display the variable, use alert(varOutput).
-Peter
----- Original Message -----
From: Shaun Chatterton
To: dsaf
Sent: Thursday, July 19, 2001 10:20 AM
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20010719/e690a9c0/attachment.htm>
More information about the Javascript
mailing list