154
rated 0 times
[
160]
[
6]
/ answers: 1 / hits: 20637
/ 10 Years ago, tue, december 16, 2014, 12:00:00
I want to check the value in text box is present in database and clear the box if the value exists in the database without refreshing the whole page.
HTML:
<p>Email<input type=text name=email id=email size=18 maxlength=50 required></p>
Query:
$echeck=select email from register where email='$email';
$echk=mysql_query($echeck);
$ecount=mysql_num_rows($echk);
if($ecount!=0)
{
echo (<SCRIPT LANGUAGE='JavaScript'>
var asign=document.getElementById(email); //now show null value
asign.value=;
</SCRIPT>);
}
If I use alert it will refresh the page.
window.alert('Email Id already exist');
More From » php