进个论坛卡30分钟,真的是韩红听了想打人,
今天学了图片滚动和弹广告和简单的表单校验提交,通俗易懂就是难得记
<script>
function show(){
var name = document.getElementById("name").value;
var pass = document.getElementById("password").value;
var avg = document.getElementById("avg").checked;
if(name =="" && pass =="" && avg ==""){
alert("请输入值后在提交");
}else if(name =="" && pass =="" ){
alert("请先输入账号和密码");
}else if(avg ==""){
alert("请选择性别");
}
if( name ==""){
return false;
}
if( pass ==""){
return false;
}
if(!avg){
return false;
}
}
var shengshi=new Array(4);
shengshi[0] =new Array("杭州市","温州市","绍兴市","嘉兴市","金华市","宁波市");
shengshi[1] =new Array("安顺市","贵阳市","遵义市","兴义市","六盘水市","凯里市","毕节市");
shengshi[2] =new Array("广州市","深圳市","佛山市","肇庆市","惠州市","东莞市","珠海市","湛江市");
shengshi[3] =new Array("福州市","泉州市","厦门市","闽北市");
function sheng(value){
va= document.getElementById("se2") ;
for(var k=va.options.length;k>0;k--){
va.options[k]=null;
}
for(var i=0;i<shengshi.length;i++){
if(value==i){
for(var j=0;j<shengshi[i].length;j++){
aaa = document.createElement("option");
bbb = document.createTextNode(shengshi[i][j]);
aaa.appendChild(bbb);
va.appendChild(aaa);
}
}
}
}
</script>
</head>
|
|