我想要完全相同的东西,但否则它将打开我的其他 .htm 文件的链接。整个代码都很好,但是当我在 textfeild 中输入内容时,我希望链接出现在警报或主窗口中。
<script Language="JavaScript">
<!--
function Blank_TextField_Validator() {
// Check the value of the element named text_name from the form named text_form
if (text_form.text_name.value == "") {
// If null display and alert box
alert("Please fill in the text field.");
// Place the cursor on the field for revision
text_form.text_name.focus();
// return false to stop further processing
return (false);
}
// If text_name is not null continue processing
return (true);
}
-->
</script>
<form name="text_form" method="get" action="#" onsubmit="return Blank_TextField_Validator()">
<input type="text" name="text_name" >
<input type="submit" value="Submit">
</form>