Monday, 25 May 2015

validation jq and js

<?php$con=mysqli_connect('localhost','root','','bijal');if(@mysqli_connect_errno()){echo mysqli_connect_error();die;}?>
<html>
<head>
<script src='view/jq1.js'>
</script>
</head>
<body>
<table>
<form method='post' action='index.php?op=insert' id='sub' enctype="multipart/form-data">
<tr>
<td>First name</td>
<td><input type='text' name='fname' id='fn'></td>
<td><span style='display:none;color:red' id='sp1' >enter first name</span></td>
</tr>
<tr>
<td>Last name</td>
<td><input type='text' name='lname' id='ln'></td>
<td><span style='display:none;color:red' id='sp2'>enter last name</span></td>
</tr>
<tr>
<td>Email ID</td>
<td><input type='email' name='eid' id='eid'></td>
<td><span style='display:none;color:red' id='sp3'>enter email id</span></td>
<td><span style='display:none;color:red' id='old'>email already used</span></td>
<td><input type='hidden' name='go' id='go'></td>
</tr>
<tr>
<td>Password</td>
<td><input type='password' name='pass1' id='pass'></td>
<td><span style='display:none;color:red' id='sp4'>enter password</span></td>
</tr>
<tr>
<td>Re-enter Password</td>
<td><input type='password' name='pass2' id='pass2'></td>
<td><input type='hidden' name='checkpass' id='checkpass'></td>
<td><span style='display:none;color:red' id='sp5'>password not match</span></td>
</tr>
<tr>
<td>Birth Date</td>
<td><input type='date' name='date' id='d' max=<?php echo date("Y-m-d") ?>></td>
<td><span style='display:none;color:red' id='sp6'>date not selected</span></td>
</tr>
<tr>
<td>Gender</td>
<td>male<input type='radio' name='gen' value='male' > female<input type='radio' name='gen' value='female' ></td>
<td><span style='display:none;color:red' id='sp10'>gender not selected</span></td>
<p></p>
</tr>
<tr>
<td>hobbies</td>
<td>reading<input type='checkbox' name='h1' id='h1' class='chkbox' > learning<input type='checkbox' name='h2' id='h2' class='chkbox'> cricket<input type='checkbox' name='h3' id='h3' class='chkbox'></td>
<td><span style='display:none;color:red' id='sp12'>please select one hobby</span></td>
</tr>
<tr>
<td>coutry</td>
<td>
<select name='country' id='country'>
<option value='0'>select one</option>

<?php   
   $sql="select * from con";   $x=mysqli_query($con,$sql);   while($row=mysqli_fetch_array($x))   {   echo "<option value=".$row['cid'].">".$row['cname']."</option>";   }?>
<!--<option value='1'>India</option><option value='2'>USA</option><option value='3'>England</option>--></select>
</td>
<td><span style='display:none;color:red' id='spcon'>select one country</span></td>
</tr>
<tr>
<td>state</td>
<td>
<select name='state' id='state' >
<option value='0'>select one</option>
</select>
</td>
<td><span style='display:none;color:red' id='spstate'>select one state</span></td>
</tr>
<tr>
<td>city</td>
<td>
<select name='city' id='ct'>
<option value='0'>select one</option>
</select>
</td>
<td><span style='display:none;color:red' id='sp7'>select one city</span></td>
</tr>
<tr>
<td>Profile pic:</td>
<td><input type="file" name="fupload" id="file" /></td>
<td><span style='display:none;color:red' id='spfi'>select img</span></td>
<td colspan="2">
 <fieldset>
  <legend>Profile Pic comditions:</legend>
  Type should be jpg, jpeg, or png<br>
  size should be less then 1mb<br>  
 </fieldset>
</td>
</tr>
<tr>
<td>
<input type='submit' value='add'>
</td>
<td>already member<a href="index.php?op=login"><b>Login here</b></a></td>
<td><div id='watch'></div></td>
</tr>
</form>
</table>
<div id='res'></div>

</body>
</html>

No comments:

Post a Comment