Textbox validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slekshmipriya
    New Member
    • Mar 2007
    • 7

    Textbox validation

    Hai friends i have a problem with my code.When my form get loaded it will contain the rollno, name and textbox to enter mark of the students.These are fetched from my table named details.The marks are to be entered by the enduser.The thing i want is that when i click the submit button on this form, i want to check whether all the marks are entered.I want to validate these textboxes.Can i use onblur event to do this validation?If so, how i can apply this to all these textboxes?The code is as below. details is the table , from which i fetch the name and roll number.mark is the name of the textboxes.So please help me


    <?php
    $con=mysql_conn ect("localhost" ,"root","mysql" ) or die("could not connect to MySql");
    mysql_select_db ("recruitment", $con);
    $rll=mysql_quer y("select * from details");
    while($res=mysq l_fetch_array($ rll))
    {
    echo "<tr>
    <td align=center>". $res[rno]."<input type=hidden name=rollno value='".$res[rno]."'</td>
    <td align=center>". $res[name]."</td>
    <td align=center><i nput size=7 type=text name=mark>

    </td></tr>";

    }

    ?>
    <tr><td align=center colspan=10><inp ut type='submit' value='SUBMIT' onclick='return validation()'></td></tr>
    </table>
Working...