function divopen(Obj, Flag)
{
if(Flag)
{
Obj.style.display="block";
}
else
{
Obj.style.display="none";
}
}
function divopen2(Obj)
{
if(Obj.style.display=="block")
{
Obj.style.display="none";
}
else
{
Obj.style.display="block";
}
}
<span class="fontBgreen" οnclick="divopen2(Div_a)">问题补充:</span>
<span class="fontBgreen" οnclick="divopen(Div_e, false)">取消</span>
function formSubmit(form){
if(form.addContent.value==''){
alert('请输入添加内容');
return false;
}
return true;
}
<form action="<%=path%>/Tao/index.html?method=answerQuestion&questionId=${quizForm.question.questionId}" name="question_add" method="post">
<select name="prize">
<option value="10">10
<option value="20">20
<option value="50">50
</select>
</form>
//
<script>
function formSubmit( form ){
if(form.txt.value==''){
document.getElementById("error_div").innerHTML="不能为空";
document.getElementById("error_div").style.display="block";
return false;
}
return true;
}
</script>
<form οnsubmit="return formSubmit(this)">
<input type="text" name="txt" style="float:left"/><div id="error_div" style="float:left;color:red;display:none"></div>
<br />
<input type="submit" value="提交" />
</form>
//
文本标签也能提交表单
<a href="#" οnclick="document.formname.submit()">submit botton</a>