creaing a registration form in php
<p>Hi I have created a registration form(sample one fro trial).  But if i dont give the value in the field,still it submit. So I need to validate the field using java script and have to give a message"please fill the form" if the field is kept empty.
this is my code</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;form name="reg1" action="try.php" method="post"&gt;
&lt;table&gt;
&lt;table border="0" cellpadding="0" cellspacing="0" width="779" align="centre"&gt;
&lt;tr&gt;
&lt;th&gt;Registration form&lt;/th&gt;&lt;/tr&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;TD align="left"&gt;username&lt;TD/&gt;
&lt;TD&gt;&lt;input type="text" name= "usr"&gt;&lt;/TD&gt;&lt;/tr&gt;

&lt;tr&gt;
&lt;td align="left"&gt;address1&lt;td/&gt;
&lt;td&gt;&lt;input type="text" name="addr1"&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td align="left"&gt;address2&lt;td/&gt;
&lt;td&gt;&lt;input type="text" name=addr2&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td align="left"&gt;password&lt;td/&gt;
&lt;td&gt;&lt;input type="password" name="pswd"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;TD&gt;&lt;/TD&gt;
&lt;td&gt;&lt;input type="submit" name="submit" value="submit"&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>can please anyone help????</p>
