回 帖 发 新 帖 刷新版面

主题:谁给我看看????

我这样写可以不。
我有2个单选按扭

function check()
{  
if (document.form1.radio1.value==1)
{
  String sql="select * from user_admin where user='"+user+"'";

if (document.form1.radio2.valut==2)
{
  String sql="select * from user_admin where telephone='"+telephone+"'";
}
}

回复列表 (共6个回复)

沙发

valut是什么?

板凳

function check()
写错了。
那我这语句有问题没???/
{  
if (document.form1.radio1.value==1)
{
  String sql="select * from user_admin where user='"+user+"'";

if (document.form1.radio2.value==2)
{
  String sql="select * from user_admin where telephone='"+telephone+"'";
}
}

3 楼

你运行一下,看看有没有提示错误
你去掉String再试试,
或者改一下这个
document.form1.radio1[0].value==1
document.form1.radio2[0].value==2

4 楼

为什么我加了个else就有问题呢
如果我把
else

<% String sql="select * from user_admin where telephone='"+telephone+"'";%>
}去掉,运行就没问题,我这else代码问题出在哪呢
<script language="javascript"> 
function check()
{  
if (document.form1.radio1.value==1)
{
<% String sql="select * from user_admin where user='"+user+"'";%>
}
else

<% String sql="select * from user_admin where telephone='"+telephone+"'";%>
}
}
</script>

5 楼

不能用javascript来控制asp

6 楼

我这程序是JSP

我来回复

您尚未登录,请登录后再回复。点此登录或注册