查看: 791|回复: 1
|
HTML button 问题
[复制链接]
|
|
我有个TEXTBOX 和 button..
如果我想把它设置成。。
当USER输入‘A’, 就会link去 A.htm
当USER输入‘B’, 就会link去 B.htm
要怎么做呢?
因为一个button只能link去一个htm...
我要怎么set呢? |
|
|
|
|
|
|
|
发表于 16-12-2005 05:42 AM
|
显示全部楼层
<script language=javascript>
function checkLink(){
if (document.form1.T1.value=="A"){
document.form1.action="http://www.yahoo.com";
}
else
if (document.form1.T1.value=="B"){
document.form1.action="http://www.google.com";
}
}
</script>
<body>
<form name=form1 method="POST">
<p><input type="text" name="T1" size="20" onchange="javascript:checkLink()"><input type="submit" value="Submit" name="B1"></p>
</form> |
|
|
|
|
|
|
| |
本周最热论坛帖子
|