Re: variable form action

by =?iso-8859-1?q?andy=20dunbar?= <krone9(at)yahoo.com>

 Date:  Tue, 19 Sep 2000 05:49:09 -0700 (PDT)
 To:  Ed Lazor <osmosis(at)atfantasy.com>,
hwg-style(at)hwg.org
  todo: View Thread, Original
no hassle:

if your form is called form1 like the following form:



<html>
<head>

<script language="javascript">
function actionchange(){

if (document.form1.choice.value=="bill"){
document.form1.action =
"javascript:alert('billgates(at)microsoft.com')" ;
return true;
} 

if (document.form1.choice.value=="george"){
document.form1.action =
"javascript:alert('georgelucas(at)starwars.com')" ;
return true;
}
alert('I do not know that person');
return false;
}
</script>
</head>
<body>
Please enter 'bill' or 'george' to get that person's
email<br>
<form name="form1" action="javascript:alert('action
has not been changed')" onsubmit="return
actionchange()">
<input name="choice" value="bill" type="text">
<input type="submit" value="submit">
</form>
</body>
</html>


hope that helps!

@ndy

__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

HWG hwg-style mailing list archives, maintained by Webmasters @ IWA