<html>
<head>
<script type="text/javascript" src="updatejs"></script>
<form action = "updatephp" method = "POST">
</form>
</head>
<body>
<form action = "testphp" onsubmit="return my_check();" method = "POST">
<table>
<tr><td><label for = "id">文件号:</label></td><td><input type = "text" size="8" name = "id" id='my_id' /></td></tr>
<tr><td><label for = "user">姓名:</label></td><td><input type = "text" size = "8" name = "user" /></td></tr>
<tr><td><input type = "submit" name = "submit" value = "提交更新"/>
<input type = "hidden" name = "action" value = "add" />
<input type = "reset" name = "reset" value = "重新填写" /></td></tr>
</table>
</form>
</body>
</html>
<script language=javascript>
function my_check(){
var a = documentgetElementById("my_id");
if(avalue==""){
alert ("文件号不能为空"+"\n"+"请加上");
afocus();
return(false);
}
else{
return(true);
}
}
</script>
<
$act = $_POST['action'];
if($act == 'add'){
$id = $_POST['id'];
echo "您输入了"$id;
}
>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)