I have this input field
<input name="question"/>
I want to call IsEmpty function when submit clicking submit button.
I tried the code below but did not work.
any advice?
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=unicode" />
<meta content="CoffeeCup HTML Editor (www.coffeecup.com)" name="generator" />
</head>
<body>
<script language="Javascript">
function IsEmpty() {
if (document.form.question.value == "") {
alert("empty");
}
return;
}
</script>
Question: <input name="question" /> <br/>
<input id="insert" onclick="IsEmpty();" type="submit" value="Add Question" />
</body>
</html>
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…