第二步:
<form name="form1" action="http://jlpt.etest.net.cn/bkServlet" method="post" target="main">//目标网页
级别 <select name="lstJb" size="1" onchange="UpdateData()" class="v10bk" style="width:80">//注意对应lstJb
<option value="1">一级</option>
<option value="2">二级</option>
<option value="3" selected>三级</option>
<option value="4">四级</option>
</select>
考点:<br>
<input type="button" value="大连理工大学" name="btnThird1" onclick="GoThird1()" class="v10bk" style="width:70"> <input type="button" value="大连外国语学院" name="btnThird2" onclick="GoThird2()" class="v10bk" style="width:85"><br>
<input type="button" value="辽宁师范大学" name="btnThird3" onclick="GoThird3()"class="v10bk" style="width:70"> <input type="button" value="辽宁大学教务处" name="btnThird4" onclick="GoThird4()"class="v10bk" style="width:85"><br><br>
<input class="v10bk" type="button" value="在窗口中显示所有学校" name="btnSecond" onclick="GoSecond()" style="width:160">
<td class="v10bk">考点编码<input name="kddm" class="v10bk"><br>
考点名称<input name="kdmc" class="v10bk"><br>
考试等级<input name="level" class="v10bk"><br>
级别名称<input name="jbmc" class="v10bk">
<input type="submit" value="选择该考场" name="btnSubmit" class="v10bk" onclick="return ValidateForm()">
function UpdateData(){
try{
jb=form1.lstJb.options[form1.lstJb.selectedIndex].value;
}
catch(e){
jb=3;
}
if(jb==1){
level=1;
jbmc="日语一级";
}
else if(jb==2){
level=2;
jbmc="日语二级";
}
else if(jb==3){
level=3;
jbmc="日语三级";
}
else{
level=4;
jbmc="日语四级";
}
form1.level.value=level;
form1.jbmc.value=jbmc;
}
UpdateData();
}
//学校选择
function GoThird1(){
UpdateData();
form1.kddm.value="1020403";
form1.kdmc.value="大连理工大学外国语学院";
}
function GoThird2(){
UpdateData();
form1.kddm.value="1020401";
form1.kdmc.value="大连外国语学院考试中心";
}
function GoThird3(){
UpdateData();
form1.kddm.value="1020402";
form1.kdmc.value="辽宁师范大学教务处考试中心";
}
function GoThird4(){
UpdateData();
form1.kddm.value="1020601";
form1.kdmc.value="辽宁大学教务处";
}
//判断是否没选择东西
function ValidateForm(){
if((form1.kddm.value=="")||
(form1.kdmc.value=="")||
(form1.level.value=="")||
(form1.jbmc.value=="")){
alert("请填写详细数据!");
return false;
}
return true;
}