常用 javascript
//判断是否是数字
function isNumber(obj){
var i;
strRef = "1234567890.";
for (i=0;i<obj.value.length;i++) {
tempChar=obj.value.substring(i,i+1);
if (strRef.indexOf(tempChar,0)==-1) {
alert("请填数字,不要带单位和任何其他字符!");
obj.focus();
return false;
}
}
return true;
}
//提交判断
function f_submit(){
var doc=document.forms[0];
var msg;
var aa;
var i;
var msgflag;
msgflag = "false";
if(typeof(doc.AcceptVendor.length)=="undefined"){
if (!(doc.AcceptVendor.checked)){
msg="请选择最后确定的供应商!";
msgflag="true";
doc.AcceptVendor.focus()
}
}
if(typeof(doc.AcceptVendor.length)!="undefined"){
for (i=0;i<doc.AcceptVendor.length;i++){
if (doc.AcceptVendor[i].checked){
aa=doc.AcceptVendor[i].value;
}
}
if (!aa){
msg="请选择最后确定的供应商!";
msgflag="true";
doc.AcceptVendor[0].focus()
}
}
if (doc.yesorno[0].checked){
if((doc.yusuan.value=="")||(doc.yongtu.value=="")){
msg="请输入付款专项预算具体信息!";
msgflag="true";
doc.yusuan.focus()
}
if((doc.yusuan.value=="")&&(doc.yongtu.value=="")){
msg="请输入付款专项预算具体信息!";
msgflag="true";
doc.yusuan.focus()
}
}
if(doc.amount.value == ""){
msg="请输入预期购买数量!";
msgflag="true";
doc.amount.focus()
}
if(doc.amount.value <= 0){
msg="请正确输入购买数量!";
msgflag="true";
doc.amount.focus()
}
if (doc.Equipment.selectedIndex==0){
msg="请选择你要采购的设备类别!";
msgflag="true";
doc.Equipment.focus()
}
if((parseFloat(money1)+parseFloat(money2)+parseFloat(money3) > 2000)&(doc.type[0].checked)){
msg="对不起,金额超过2000元的借款,请选择汇款方式!";
msgflag="true";
doc.type[1].focus()
}
if(msgflag == "true"){
alert(msg);
return false;
}
if (msgflag == "false"){
doc.b_approved.disabled = true;
doc.savedoc.onclick();
}
}
window.open(loadpos,"surveywin","toolbar,resizable,scrollbars,dependent,width=400,height=280")
<BODY lang=ZH-CN style="TEXT-JUSTIFY-TRIM: punctuation; tab-interval: 21.0pt" vLink=#aa00aa link=blue scroll=yes οnlοad='window.open("http://12345.com'>