I wish to use form validation. I have tried personally javascript with this and that i have downloaded the com_php0.1alpha-J15.tar component for writing php code however the blank records are would go to the database. Please guide me... sample code is here now...

<script language="javascript" type="text/javascript">

 function Validation()

 title").value=="")

  Title"

   document.getElementById("title").style.backgroundColor = "yellow"

  

  else

  title").style.backgroundColor = "Whitened"

  

  if(document.getElementById("email").value=="")

  

  else

  Whitened"

          

  if(document.getElementById("phone").value=="")

  

  else

  Whitened"

                

  if(document.getElementById("society").value=="")

  

  else

  Whitened"

  

  if(document.getElementById("occupation").value=="")

  

  else

  Whitened"

         

  if(document.getElementById("feedback").value=="")

  

  else

  Whitened"

  

  if(document.getElementById("title").value==""  document.getElementById("email").value==""

   document.getElementById("phone").value==""  document.getElementById("society").value==""

   document.getElementById("occupation").value==""  document.getElementById("feedback").value=="")

   return false

  else

   return true

 

</script>

<?php

 if(isset($_Publish['submit']))

 choose_db('society_f',$conn)

   $title = $_Publish['name']

   $email =  $_Publish['email']

   $phone =  $_Publish['phone']

   $society =  $_Publish['society']

   $occupation = $_Publish['occupation']

   $feedback =  $_Publish['feedback']

   $qry =  "place into feedback values(null". ",'" . $title . "','" . $email . "','" . $phone . "','" . $society . "','" . $occupation . "','" . $feedback . "')"

   $res = mysql_query($qry)

   if(!$res)

   

 

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1. Transitional//EN" "http://world wide web.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://world wide web.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html charset=iso-8859-1" />

<title>Untitled Document</title>

<style type="text/css">

 .td

 .text

</style>

</mind>

<body>

<form id="form1" method="publish">

<input type="hidden" title="check" value="publish"/>

 <table border="" align="center" cellpadding="2" cellspacing="2">

  <tr>

   <td colspan="3" style="text-align:center"><span style="font-size:24pxcolor:#000066">Feedback Form</span></td>

  </tr>

  <tr>

   <td class="td">Name</td>

   <td><input type="text" id="title" title="title" class="text" ></td>

   <td style="font-style:italiccolor:#FF0000" id="nameerr"></td>

  </tr>

  <tr>

   <td class="td">E-mail</td>

   <td><input type="text" id="Email" title="Email"  class="text"></td>

   <td style="font-style:italiccolor:#FF0000" id="emailerr"></td>

  </tr>

  <tr>

   <td class="td">Contact No</td>

   <td><input type="text" id="Phone" title="Phone"  maxlength="15" class="text"></td>

   <td style="font-style:italiccolor:#FF0000" id="Phoneerr"></td>

  </tr>

  <tr>

   <td class="td">Your Society</td>

   <td><input type="text" id="society" title="society"  class="text"></td>

   <td style="font-style:italiccolor:#FF0000" id="societyerr"></td>

  </tr>

  <tr>

   <td class="td">Occupation</td>

   <td><input type="text" id="occupation" title="occupation"  class="text"></td>

   <td style="font-style:italiccolor:#FF0000" id="occupationerr"></td>

  </tr>

  <tr>

   <td class="td">Feedback</td>

   <td><textarea title="feedback" id="feedback" class="text"></textarea></td>

   <td style="font-style:italiccolor:#FF0000" id="feedbackerr"></td>

  </tr>

  <tr>

   <td colspan="3" style="text-align:center">

    <input type="submit" value="Submit" id="submit" onClick="Validation()" />

    <input type="totally reset" value="Totally reset" onClick="Resetme()" />

   </td>

  </tr>

  </table>

</form>

</body>

</html>