<script>
function PerformSubmit(user) {
document.chatForm.msgTo.value=user;
return false;}
</script>
<a href="#" onclick="PerformSubmit('a')" >a</a>
<a href="#" onclick="PerformSubmit('b')" >b</a>
<form name="chatForm" method="post" >
<input type="text" name="msgTo" >
先点击 a 然后点击 b
在 input text 中显示 a,b
这个怎么实现 请高手指点
function PerformSubmit(user) {
document.chatForm.msgTo.value=user;
return false;}
</script>
<a href="#" onclick="PerformSubmit('a')" >a</a>
<a href="#" onclick="PerformSubmit('b')" >b</a>
<form name="chatForm" method="post" >
<input type="text" name="msgTo" >
先点击 a 然后点击 b
在 input text 中显示 a,b
这个怎么实现 请高手指点
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head><body>
<script>
function PerformSubmit(user) {
document.chatForm.msgTo.value+=user;
return false;}
</script>
<a href="#" onclick="PerformSubmit('a')" >a</a>
<a href="#" onclick="PerformSubmit('b')" >b</a>
<form name="chatForm" method="post" >
<input type="text" name="msgTo" >
</body>
</html>
<script>
var i=0;
function PerformSubmit(user) {
if(i){document.chatForm.msgTo.value+=",";}
i=1;
document.chatForm.msgTo.value+=user;
return false;
}
</script>
<a href="#" onclick="PerformSubmit('a')" >a</a>
<a href="#" onclick="PerformSubmit('b')" >b</a>
<form name="chatForm" method="post" >
<input type="text" name="msgTo" >