2010-08-10 48 views
0

如何从一个文本框中删除文本喜欢 -如何从文本框中删除(空)文本?

elseif($num_rows >= 1) 
{ 
?> 
    <script> 
     document.getElementById("newid").value=""; 
    </script> 
<?php 
echo "<font color='Red'><b>$logid</b> Ligin name has already been taken, Please chose another Login name.</font>"; 
} 

这个代码我使用通过Ajax,但是这是行不通的。 newid id text box control id on php login page

回答

0

我猜你想设置的innerHTML清空,而不是价值:

document.getElementById("newid").innerHTML="";