<javascript>
function ff(fr)
{
if (fr.text.value == "")
{
alert("不也许");
return (false);
}
} <input name="imageField2" type="image" onclick="ff(this.form)" src="444.jpg">
function ff(fr)
{
if (fr.text.value == "")
{
alert("不也许");
return (false);
}
} <input name="imageField2" type="image" onclick="ff(this.form)" src="444.jpg">
<form name="form1" method="post" action="aaa.asp">
<input name="text" type="text" id="text">
<input name="imageField2" type="image" onclick="return bot_onclick()" src="444.jpg">
</form>
function bot_onclick()
dim aaa
set aaa=document.form1
if form1.text.value="" then
msgbox "空"
bot_onclick = false
else
aaa.submit
end if
end function
通常用JS做前台的输入判断的……
<input name="text" type="text" id="text">
<input name="imageField2" type="image" src="444.jpg">
</form><script language="vbscript">
<!--
function bot_onclick()
dim aaa
set aaa=document.form1
if form1.text.value="" then
msgbox "空"
bot_onclick = false
else
aaa.submit
end if
end function
-->
</script>
<script language="JavaScript" type="text/JavaScript">
function xylegend()
{
if (document.insert_form.text.value=="")
{
alert("请填写正确再提交!");
return false;
}
</script>
<form name="form1" method="post" action="aaa.asp">
<input name="text" type="text" id="text">
<input name="imageField2" type="image" src="444.jpg">
</form>
script language="JavaScript" type="text/JavaScript">
for( var i=0;i<document.form1.elements.length;i++){
if(document.form1.elements[i].type == 'text'){
if( '' == document.form1.elements[i].value ){
alert("请输入值!");
document.form1.elements[i].focus();
return false;
}
}
}
</script>
<form name=form1 ENCTYPE="multipart/form-data" method="post" action=<?PHP_SELF?>"aaa.asp" onSubmit="return Check()" >
<input name="text" type="text" id="text">
<input name="imageField2" type="image" src="444.jpg">
</form>
上面实现了对页面中所有的为txt的进行查检,我想这是比较简单又实用的一个了
上面几楼朋友的JavaSCript都能满足你的需求的