日期:2014-05-17  浏览次数:20913 次

菜鸟50分跪求解~!两个文本框对比输入的限制~!请CSDN高手指教~!在线急等~!
<tr>
<td> 最大可领数 </td>
<td> <input   type= "text "   name= "x_6700592753EF98866570 "   id= "x_6700592753EF98866570 "   size= "30 "   maxlength= "50 "   value= " <%=   Server.HTMLEncode(x_6700592753EF98866570& " ")   %> "> </td>
</tr>
<tr>
<td> 领料数 </td>
<td> <span   id= "cb_x_5B8C6210603B6570 ">
<input   type= "text "   name= "x_5B8C6210603B6570 "   id= "x_5B8C6210603B6570 "   size= "30 "   maxlength= "50 "   value= " <%=   Server.HTMLEncode(x_5B8C6210603B6570& " ")   %> "> </td>

</tr>

领料数输入的时候,不能大过最大可领数~!怎么做啊????

------解决方案--------------------
<body>
<form name=form1>
<input type=text name= "price1 "> <br>
<input type=text name= "price2 "> <br>
<input type=button value= "比较大小 " onclick= "check() "> <br>
</form>
<script>
function check()
{
var price1=parseFloat(document.all.form1.price1.value);
var price2=parseFloat(document.all.form1.price2.value);
if(price1> price2)
alert( 'price1大于price2 ')
else
alert( 'price1小于price2 ')
}
</script>
</body>