VBscript过程的一个参数传递问题
来源:百度知道 编辑:UC知道 时间:2024/05/24 06:32:42
现有一个HTML页面,里面有一个表单form1,表单包括一个按钮,一个文本域,怎么样单击按钮使文本域里面的内容为"欢迎来到这里",
问题是单击按钮后怎么将那个文本域对象传入要调用的子过程mySub(),通过这个过程来添加那个文字....
以下我写好了部分内容.
<html>
<head><title>改变文本域内容</title>
<sctipt language="vbscript">
sub mySub()
'..............................................
end sub
</script>
</head>
<body>
<form name="form1" method="POST" action="">
<input type="button" name="btn1" value="确定">
<br> <textarea cols="60" rows="8" name="myText"></textarea>
</form>
</body>
</html>
问题是单击按钮后怎么将那个文本域对象传入要调用的子过程mySub(),通过这个过程来添加那个文字....
以下我写好了部分内容.
<html>
<head><title>改变文本域内容</title>
<sctipt language="vbscript">
sub mySub()
'..............................................
end sub
</script>
</head>
<body>
<form name="form1" method="POST" action="">
<input type="button" name="btn1" value="确定">
<br> <textarea cols="60" rows="8" name="myText"></textarea>
</form>
</body>
</html>
<html>
<head><title>改变文本域内容</title>
<sctipt language="vbscript">
sub mySub()
'..............................................
dim m
m=document.getElementById("myText")
m就是文本域的对象
end sub
</script>
</head>
<body>
<form name="form1" method="POST" action="">
<input type="button" name="btn1" onclick="mySub()" value="确定">
<br> <textarea cols="60" id="myText" rows="8" name="myText"></textarea>
</form>
</body>
</html>
用JS吧
<script>
function chMsg(msg){
document.getElementById("test").value=msg;
}
</script>
==============================
<form>
<input type="but