我正在使用这个文本区域,以便用户可以在这里写一些文本,我正在使用onblur
,onfocus
所以当用户单击默认文本时它不显示,我提供一些消息作为默认值,问题是当用户写一些东西时这个文本区域比默认值也存储在数据库中,输入了其他文本,错误在哪里?我在这个变量中取值$nature_speci
$nature_speci = trim(mysql_prep($_POST['other_naturespeci']));
这是文本区域的 html 代码
<textarea id="other_naturespeci" name="other_naturespeci" size="30" maxlength="100" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;">Assignment Specification in Few Words.<?php if (isset($errors)) { echo $_POST['other_naturespeci'];}elseif(isset($_GET['other_naturespeci'])){ echo $_GET['other_naturespeci'];} ?></textarea>