这种判断代码该怎样写呢
我是要实现用帐号和电话2种方式来查询数据库
但用户用帐号查询的时候就执行A SQL语句
当用户用电话查询的时候就执行B SQL语句
<form action= " " method= "post " name= "form1 ">
<center>
<input type= "radio " name= "radio " value= "1 " /> 帐号: <input type= "text " name= "user " value= " " /> <br />
<input type= "radio " name= "radio " value= "2 " /> 电话: <input type= "text " name= "telephone " value= " " /> <br /> <br />
<input type= "submit " name= "submit " value= "确定 " onclick= "check() " />
</center>
</form>
------解决方案--------------------刚刚不回答了 不正确吗
http://community.csdn.net/Expert/topic/5572/5572171.xml?temp=6.249636E-02
你要什么效果?
------解决方案--------------------不是很简单吗?
servlet端:
if ( "1 ".equals(request.getParameter( "radio "))) {
// 执行a查询
}
else if ( "2 ".equals(request.getParameter( "radio "))) {
// 执行b查询
}