メール欄にテキストが入力されているかどうかを確認する機能がありますが、機能していません。
何が欠けているのかわかりません。
これは私のフォームです:
<fieldset>
<legend>Contact Information</legend>
<form action="" id="contactInfo" onsubmit="checkform()">First Name:
<input type="text" name="fname" id="fname">
<br />Last Name:
<input type="text" name="lname" id="laname">
<br />Email:
<input type="text" name="email" id="email">
<br />
<button type="submit">Submit</button>
</form>
</fieldset>
.js
これは別のファイルにある私の関数です
function checkform(form) {
if (document.form.email.value = "") {
alert("Please enter your email address.");
document.form.email.focus();
return false;
}
return true;
}