我的脚本不应该让HTML表单被提交,除非用户将一些数据输入到textarea控件中。但是,表单无论如何都会被提交,并且不会显示用户的消息。 任何人都可以看到我做错了什么?Textarea验证
这里是我的HTML:
<textarea name="description" id="description" rows = "4" cols = "25">
<?php echo $description?>
</textarea>
对于PHP,这也不:
if ($_POST['description'] == "") {
$errors .= 'Please enter a description of your invention.<br/><br/>';
}
或本:
if (empty($_POST['description'])) {
$errors .= 'Please enter a description of your invention.<br/><br/>';
}
工作。
发布完整的脚本与相关部分 – 2010-10-25 16:21:22