87,907
社区成员
发帖
与我相关
我的任务
分享
<table>
<form name="form1">
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from confine where class="&bclass,conn,1,1
do while not rs.eof
response.Write "<tr>"
response.Write "<td class=""TableRow2"">"
response.Write rs("confine")&":"
response.Write "</td>"
set rss=server.CreateObject("adodb.recordset")
rss.open "select * from confine_value where confine="&rs("id"),conn,1,1
response.Write "<td class=""TableRow2"">"
do while not rss.eof
response.Write "<label><input type=""radio"" name="""&rs("confine")&""" value="""&rss("id")&""">"&rss("value")&"</label> "
aa=rs("confine")
rss.movenext
loop
response.Write "</td>"
rss.close
set rss=nothing
response.Write "</tr>"
rs.movenext
loop
'rs.close
'set rs=nothing
'
'conn.close
'set conn=nothing
%>
<input type="button" name="btnSon" id="btnSon" value="提交" onClick="setValue();" />
</form>
</table>
<script type="text/javascript">
//此方法用于向其父文本框类赋值
function setValue(){
for(j=0;j<<%=rs.recordcount%>;j++){
for(i=0;i<document.form1.<%=aa%>.length;i++)
{
if(document.form1.<%=aa%>[i].checked)
{
var sonValue=document.form1.<%=aa%>[i].value;
//alert("您选择的是:"+document.form1.txtSon[i].value);
}
}
}
//向父类文本框赋值
parent.document.form1.txtFather.value=sonValue;
}
</script>
function setValue(){
for(j=0;j<<%=rs.recordcount%>;j++){
var sonValue = '';
for(i=0;i<document.form1.<%=aa%>.length;i++)
{
if(document.form1.<%=aa%>[i].checked)
{
sonValue += document.form1.<%=aa%>[i].value+',';
//alert("您选择的是:"+document.form1.txtSon[i].value);
}
}
}
//向父类文本框赋值
parent.document.form1.txtFather.value=sonValue.substring(0,sonValue.length-1);
}
<script type="text/javascript">
//此方法用于向其父文本框类赋值
function setValue(){
var RadioGroupName;
var t;
var flag;
var result = [];
for(j=0;j<<%=rs.recordcount%>;j++){
t="t"+j;
RadioGroupName=document.getElementsByName(t)
for(var i=0;i<RadioGroupName.length;i++)
{
if(RadioGroupName[i].checked)
{
result.push(RadioGroupName[i].value);
}
}
}
var sonValue = result.join(",");
document.write (sonValue)
alert("您选择的是:"+sonValue);
//向父类文本框赋值
//parent.document.form1.txtFather.value=sonValue;
}
</script>
<script type="text/javascript">
//此方法用于向其父文本框类赋值
function setValue(){
var RadioGroupName;
var t;
var flag;
for(j=0;j<<%=rs.recordcount%>;j++){
t="t"+j;
RadioGroupName=document.getElementsByName(t)
for(var i=0;i<RadioGroupName.length;i++)
{
if(RadioGroupName[i].checked)
{
var sonValue=RadioGroupName[i].value;
//document.write (sonValue)
alert("您选择的是:"+sonValue);
}
}
}
//向父类文本框赋值
//parent.document.form1.txtFather.value=sonValue;
}
</script>