⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 script.js

📁 上学期软件工程作业,是一个自行车销售管理网站系统.
💻 JS
字号:
function login(){
	var name = document.getElementById("userName").value;
	var password = document.getElementById("password").value;
	var checkcode = document.getElementById("checkcode").value;
	if(name=="")
		alert("Óû§ÃûΪ¿Õ");
	else if(password=="")
		alert("ÃÜÂëΪ¿Õ");
	else if(checkcode=="")
		alert("ÑéÖ¤ÂëΪ¿Õ");
}

function deleteCustomer(){

	if(confirm("È·¶¨ÒªÉ¾³ýµÄÂð?")){
		location = "Index.jsp";
	}
}

function operateOrder(button){
	document.orderform.dealorder.value = button.name;
}

function testNumber( te,oldtext){
	var text = te.value;
	for(var i=0;i<text.length;i++){
		if(i!=0&&(text.charCodeAt(i)==47||text.charCodeAt(i)<46||text.charCodeAt(i)>57)||text>100){
			te.value=oldtext;
			break;
		}
		else if(text>1000){
		   te.value = 1000;
		}
	   else if(text.indexOf('.')!=-1){
            var bb = text.substring(text.indexOf('.')+1,text.length);
	       if(bb.indexOf('.')!=-1){
             alert('输入无效,请重新输入!');
             te.value = text.substring(0,text.indexOf('.'));
             break;
             }else{
              te.value = text;
              break;
             }
       }
		else if(i==0&&(text.charCodeAt(i)<=48||text.charCodeAt(i)>57)){
			te.value=oldtext;
			break;
		}
	}

	}
	
	function testRate( te,oldtext){
	var text = te.value;
	for(var i=0;i<text.length;i++){
		if((text.charCodeAt(i)==47||text.charCodeAt(i)<46||text.charCodeAt(i)>57)){
			te.value=oldtext;
			break;
		}
		else if(text>100){
		   te.value = 100;
		}
	   else if(text.indexOf('.')!=-1){
            var bb = text.substring(text.indexOf('.')+1,text.length);
	       if(bb.indexOf('.')!=-1){
             alert('输入有无,请重新输入!');
             te.value = text.substring(0,text.indexOf('.'));
             break;
             }else{
              te.value = text;
              break;
             }
       }
		else if((text.charCodeAt(i)<=48||text.charCodeAt(i)>57)){
			te.value=oldtext;
			break;
		}
	}

	}
	
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -