validation for particular fields like input name="",textarea,select name="".

   <form method="post" id="myform" name="myform">
 <tr><td width="170"><div align="left">Company Name<span style="color:#F00;">*</span> :</div></td><td width="317"> <input type="text" name="companyname" placeholder="Company Name" value="<?php echo ucwords(strtolower(mysql_real_escape_string($_POST['companyname']))); ?>"/></td></tr>
        <tr><td><div align="left">Contact Person Name<span style="color:#F00;">*</span> :</div></td><td> <input type="text" name="conactperson" placeholder="Contact Person Name" value="<?php echo ucwords(strtolower(mysql_real_escape_string($_POST['conactperson']))); ?>"/></td>
        </tr>
        </form>

company name is mandatory but if i go to next fields i want to display one message near that companyame text box. am searching for this still not getting.if anyone knows about this validation please help me.

thank you.. before clicking submit button validation method i want if that field is mandatory.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.