你在说清楚点
你是指在提交是一定要填写一个文本框么
如果是的话则
function aa(){
if (document.from1.text1.vlaue=="")
{
if(document.from1.text2.vlaue=="")
{
document.alert("您还没有填写完")
}
else[
document.alert("您确定您所填写的吗?")
}
}
}
<body>
<form name='from1' action=''>
<input type="text' name='text1'>
<input type="text" name="text2'>
<input type="submit' name="aa' onclick=aa()>
</from>
</body>
你是指在提交是一定要填写一个文本框么
如果是的话则
function aa(){
if (document.from1.text1.vlaue=="")
{
if(document.from1.text2.vlaue=="")
{
document.alert("您还没有填写完")
}
else[
document.alert("您确定您所填写的吗?")
}
}
}
<body>
<form name='from1' action=''>
<input type="text' name='text1'>
<input type="text" name="text2'>
<input type="submit' name="aa' onclick=aa()>
</from>
</body>
<input name=t2 size=20>
<input type=button value=check onclick="if(t1.value == '' && t2.value == ''){alert('至少写一个吧!');}else{alert('好,请继续!');}">
<script language='javascript>
function aa(){
var str1 = (document.form1.text1.value=="") &&(document.form1.text2.value=="")?"您还没有填写完" : "您确定您所填写的吗?";
document.alert(str1);
}
</script> <body>
<form name='from1' action=''>
<input type="text' name='text1'>
<input type="text" name="text2'>
<input type="submit' name="aa' onclick=aa()>
</from>
</body>
<form>
<input type=text name=a1 onclick="document.all.a2.value=''">
<input type=text name=a2 onclick="document.all.a1.value=''">
</form>
function chk()
{
if (document.all.a1.value=="" && document.all.a2.value=="")
{
alert("请选择a1 a2 中的其一进行填写");
document.all.a1.focus()
return false;
}
}
</script>
<form>
<input type=text name=a1 onclick="document.all.a2.value=''">
<input type=text name=a2 onclick="document.all.a1.value=''">
<input type=submit onclick="return chk()">
</form>