Hi. I just wonder, is it possible, to validateform , which has been "echoed" in PHP using JavaScript function?
See code below
<?php
if(isset($_SESSION['email'])){
echo"You are looged in as ".$_SESSION['email']. "</br> ";
echo' <form action="confirmlogout.php" id"logoutform" method="post">
<input type="submit"id="sub" name="sub" onclick="" value = "LOG OUT" />
</form></br>';
}
else{
echo '<h3>Please fill up registration form, to create user account</h3>
<form action="signup.php" id="signform" method="POST" onSubmit="validate()">
<ul>
<li>Please enter your first name: <input type="text" id="fname" name="fname" autofocus autocomplete="" /><div id="erfname"></div></li>
<li>Please enter your last name:  <input type="text" id="lname" name="lname" onFocus="validate()" /><div id="erlname"></div></li>
<li>Please enter your flat number:  <input type="text" id="hno" name="hno" /><div id="erfno"></div></li>
<li>Please enter your house number:  <input type="text" id="hno" name="hno" /><div id="erhno"></div></li>
<li>Please enter street name:  <input type="text" id="street" name="street" /><div id="erstreet"></div></li>
<li>Please enter your postcode:  <input type="text" id="pcode" name="pcode" /><div id="erpcode"></div></li>
<li>Please enter your email address:  <input type="email" id="email" name="email" /><div id="eremail"></div></li>
<li>Please create your password:  <input type="password" id="pwd1" name="pwd1" /><div id="erpwd1"></div></li>
<li>Please repeat your password:  <input type="password" id="pwd" name="pwd" /><div id="erpwd"></div></li>
</ul>
<input type="submit" id="submit" name="submit" onSubmit="validate()" value = "Submit" />
</form>
<a href="log_in.php">Or log in, if you are already registered</a>';
}
?>