<tr>
<td align="right" class=bgtable style="font:bold">书籍索取号:</td>
<td class=bgtable>
<input type=text name="txt_sqh" value="">
</td>
</tr>
<tr height=20><td></td><td></td><tr>
<tr>
<td colspan=2 align="center" class=bgtable>
<input type="reset" value="重置" style="background-color:#2969b5;color:#ffffff;border-style:solid;border-color:#2969b5;cursor:hand">
<input type="button" value="提交" onclick="return checkbook()" style="background-color:#2969b5;color:#ffffff;border-style:solid;border-color:#2969b5;cursor:hand">
<!-- <input type="button" value="提交" onclick="return toservlet();" style="background-color:#2969b5;color:#ffffff;border-style:solid;border-color:#2969b5;cursor:hand">-->
<!-- <input type="button" onclick="return goback();" value="取消" style="background-color:#2969b5;color:#ffffff;border-style:solid;border-color:#2969b5;cursor:hand">-->
</td>
</tr>
</table>
</div>
调用是用到的函数:
function toservlet()
{
if(document.all.txt_sqh.value=="")
{
alert("请先输入归还书的索取号!");
return false;
}
if(!confirm("你确认归还此书吗?"))
return false;
document.all.txt_type1.value = "24";
document.all.txt_type1.value = "2.2";
document.all.txt_edit.value = "1";
document.all.txt_id.value = "<%=strID%>";
document.all.txt_ifservlet.value = "-1";
document.all.form1.action = "index.jsp";
document.all.form1.submit();
}
function checkbook()
{
alert("dfdf");
if(document.all.txt_sqh.value=="")
{
alert("请先输入归还书的索取号!");
return false;
}
document.all.txt_type1.value = "24";
document.all.txt_type1.value = "2.2";
document.all.txt_edit.value = "2";
document.all.txt_id.value = "<%=strID%>";
document.all.txt_ifservlet.value = "";
document.all.form1.action = "index.jsp";
document.all.form1.submit();
}
function isDigitNew(str)
{
var strno=".";
var time=0;
var strnone=" ";
var bool = true;
for(var i=0;i<str.length;i++)
{ if(str.charAt(i)==strno)
{
if(i==0)
return false;
if(i==str.length-1)
return false;
time++;
}
else
{
if(!(str.charAt(i)>=0&&str.charAt(i)<=9))
{
bool = false;
break;
}
}
}
if(str.indexOf("..")>=0)
return false;
if(time>1)
return false;
if(str.indexOf(" ")>=0)
return false;
return bool;
}
function isDigit(str)
{
var bool = true;
for(var i=0;i<str.length;i++)
{
if(!(str.charAt(i)>=0&&str.charAt(i)<=9))
{
bool = false;
break;
}
}
return bool;
}
document.all.txt_edit.value="";function toservlet()
{
if(document.all.txt_sqh.value=="")
{
alert("请先输入归还书的索取号!");
return false;
}
if(!confirm("你确认归还此书吗?"))
return false;
document.all.txt_type1.value = "24";
document.all.txt_type1.value = "2.2";
document.all.txt_edit.value = "1";
document.all.txt_id.value = "<%=strID%>";
document.all.txt_ifservlet.value = "-1";
document.all.form1.action = "index.jsp";
document.all.form1.submit();
}