<html>
<head>
<title>无标题文档</title>
</head>
<body>
<script>
<!--
function frmChk(){
var doc = document.forms[0];
for(i = 0; i < doc.Kind.length; i++){
if(doc.Kind[i].checked){
alert(doc.Kind[i].value);
alert(doc.MLinkAdd.value);//我不知道这个是什么东东了还
break;
}
}}
-->
</script>
<form action="L.asp" method="post" name="frmInfo">
<select name="AddType">
<option value="0">手工输入</option>
</select>
<span id="Span_MLinkAdd">
<input id="MLinkAdd" name="MLinkAdd" >
</span>
<input type="radio" name="Kind" id="Kind" Value="0" checked>静态图片
<input type="radio" name="Kind" id="Kind" Value="1">GIF图片
<input type="submit" name="Submit" value="提交" onClick="return frmChk();">
</form>
</body>
</html>
<head>
<title>无标题文档</title>
</head>
<body>
<script>
<!--
function frmChk(){
var doc = document.forms[0];
for(i = 0; i < doc.Kind.length; i++){
if(doc.Kind[i].checked){
alert(doc.Kind[i].value);
alert(doc.MLinkAdd.value);//我不知道这个是什么东东了还
break;
}
}}
-->
</script>
<form action="L.asp" method="post" name="frmInfo">
<select name="AddType">
<option value="0">手工输入</option>
</select>
<span id="Span_MLinkAdd">
<input id="MLinkAdd" name="MLinkAdd" >
</span>
<input type="radio" name="Kind" id="Kind" Value="0" checked>静态图片
<input type="radio" name="Kind" id="Kind" Value="1">GIF图片
<input type="submit" name="Submit" value="提交" onClick="return frmChk();">
</form>
</body>
</html>
解决方案 »
- 怎么传送Json数据到另一个页面并且跳转啊
- 图片预览,IE6下正常,IE8下不显示,FF3.6下提示出错信息
- 今天泪奔了,装上的sql2005总是显示“无法连接服务器”求救
- 判断包含&号的字符是否相等的问题
- 在遮罩层里面相应出现遮罩层怎么写
- Firefox里面怎么通过Javascript调用Applet
- 有没有在IE7下无视Meta Refresh设置实现跳转的方法?
- new Date 的问题
- 请问:在javascript的脚本函数里能嵌vbs的代码,vbs也能给javascript变量赋值,javascript能给vbs的变量赋值么?
- Applet的在IE6下的打印问题
- 如何将HTML格式的内容转换成纯TEXT格式,反之又如何做?
- 急,请教如何用JS实现计数器。因为网页是静态的
<head>
<title>无标题文档</title>
</head>
<body>
<script>
<!--
function frmChk(){
alert(document.frmInfo.GKind.value);
return false;
}
-->
</script>
<form action="L.asp" method="post" name="frmInfo">
<select name="AddType">
<option value="0">手工输入</option>
</select>
<span id="Span_MLinkAdd">
<input id="MLinkAdd" name="MLinkAdd" >
</span>
<input type="radio" name="Kind" id="Kind" Value="0" checked onclick="document.frmInfo.GKind.value=this.value">静态图片
<input type="radio" name="Kind" id="Kind" Value="1" onclick="document.frmInfo.GKind.value=this.value">GIF图片
<input type="hidden" name="GKind" value="0">
<input type="submit" name="Submit" value="提交" onClick="return frmChk();">
</form>
</body>
</html>
对于Kind,因为2个名为kind的控件,对于2个或2个以上同名的,javascript自动生成数组的
按楼上的做法就可以!
<html>
<head>
<title>无标题文档</title>
</head>
<body>
<script>
<!--
function frmChk()
{
var aa=document.all.frminfo.kind.value
var bb=document.all.frminfo.span_mlinkadd.mlinkadd.value
alert(aa)
alert(bb)
return false;
}
-->
</script>
<form action="L.asp" method="post" name="frmInfo" id="frminfo">
<select name="AddType">
<option value="0">手工输入</option>
</select>
<span id="Span_MLinkAdd">
<input id="MLinkAdd" name="MLinkAdd" >
</span>
<input type="radio" name="Kind" id="Kind" Value="0" checked>静态图片
<input type="radio" name="Kind" id="Kind" Value="1">GIF图片
<input type="submit" name="Submit" value="提交" onClick="return frmChk();">
</form>
</body>
</html>
for(i=0;i<document.frmInfo.Kind.length;i++){//注意,超过一个的就是数组。
if (document.frmInfo.Kind[i].checked)
alert(document.frmInfo.Kind[i].value);
}
alert(document.frmInfo.MLinkAdd.value);//因为input是form表单的对象,
return false;
}