I wrote a simple page with HTML and PHP. So, before PHP I would like to check empty fields with Jquery, but I do not learn the Jquery yet, so I would appreciated if someone helped me.
<?php
if(isset($_POST[add]))
{
if(empty($_POST[name]) || empty($_POST[surname])) {echo 'All form fields are required';}
}
?>
<form action="" method=post>
<table border=0  cellspacing=10 cellpadding=5>
        <tr>
            <td>Name:</td>
            <td><input type="text" name="name" size="10" value=""></td>
        </tr>
        <tr>
            <td>Surname:</td>
            <td><input type="text" name="surname" size="10" value=""></td>
        </tr>
        <tr>
            <td colspan=2><input type="submit" name="add" value="Add"></td>
        </tr>
</table>
</form>
 
     
     
     
    