<body> <input type="radio" name="r1" value="r1" onclick="getValue();" id="radioID">radio1 <input type="text" name="text1" value="" id="t1"> get the value of the radio </body> <script type="text/javascript"> function getValue() { var v1 = document.getElementById("radioID").value; document.getElementById("t1").value = v1; } </script>改成你自己需要的就是啦。
<script language="javascript"> function print(){ var lan = "name"; document.getElementById("show").innerText = lan; } </script> <div> <input id="name" name="name" type="radio" value="" onclick="print()" /> </div> <div id="show"></div>
楼主【linjunduoduo】截止到2008-06-26 12:46:30的历史汇总数据(不包括此帖):
发帖数:0 发帖分:0
结贴数:0 结贴分:0
未结数:0 未结分:0
结贴率:-------------------结分率:-------------------
如何结贴请参考这里:http://topic.csdn.net/u/20080501/09/ef7ba1b3-6466-49f6-9d92-36fe6d471dd1.html
点击按钮的时候触发函数,在函数中将你要显示的值添加到对应的域中就好了
function type(){
string lan = "name";
string a_name = "<script language=javascript>alert('"+ lan +"');</" + "script>";
Response.Write(a_name);
}
</script><div><input name="name" type="radio" id="name" value="" onClick="type()"></div>
<div><%=a_name%></div>
这样写可以么?
document.getElementById("表单元素名").value;
可以获得比如文本框的值,然后你想怎么就怎么好了。
<input type="radio" name="r1" value="r1" onclick="getValue();" id="radioID">radio1
<input type="text" name="text1" value="" id="t1"> get the value of the radio
</body>
<script type="text/javascript">
function getValue()
{
var v1 = document.getElementById("radioID").value;
document.getElementById("t1").value = v1;
}
</script>改成你自己需要的就是啦。
function print(){
var lan = "name";
document.getElementById("show").innerText = lan;
}
</script> <div> <input id="name" name="name" type="radio" value="" onclick="print()" /> </div>
<div id="show"></div>
呵呵写一个函数,然后再单击事件里,调用这个把对应的文本框赋值就OK了啊。晕死