<script>
function CheckForm()
{
var f=document.getElementById('form');
f.action = "send.php";
f.method = "post";
var name=document.getElementById('name');
if(name.value.length == 0) {
alert("请输入您的名字!");
name.focus();
return false;
}
return true;
}
</script>
<form method="post" name="form" id="form" onsubmit="return CheckForm(this);">
<input type="text" id="name" name="name" />
<input type="submit"/>
</form>
function CheckForm()
{
var f=document.getElementById('form');
f.action = "send.php";
f.method = "post";
var name=document.getElementById('name');
if(name.value.length == 0) {
alert("请输入您的名字!");
name.focus();
return false;
}
return true;
}
</script>
<form method="post" name="form" id="form" onsubmit="return CheckForm(this);">
<input type="text" id="name" name="name" />
<input type="submit"/>
</form>
function send(){
document.form.action = "send.php";
document.form.method = "post";
if(CheckForm()!==false) document.form.submit();
}
function send_2(){
document.form.action = "send_2.php";
document.form.method = "post";
if(CheckForm()!==false) document.form.submit();
}
function CheckForm()
{
var name=document.getElementById('name');
if(name.value.length == 0) {
alert("请输入您的名字!");
name.focus();
return false;
}
return true;
}
</script>
<form method="post" name="form" id="form" onsubmit="return CheckForm(this);">
<input type="text" name="name" id="name" />
<input id="Button1" type="button" value="send" onclick="send()"/>
<input id="Button2" type="button" value="send_2" onclick="send_2()"/>
</form>