How can i Make Required fields in php not js

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marcher
    New Member
    • Dec 2010
    • 2

    How can i Make Required fields in php not js

    please ..

    i have this form

    Code:
    <FORM action="add.php" method="post">
    <TABLE width="100%" border=0>
      <TBODY>
      <TR>
        <TD align=center><FONT color=#ff0000>* </FONT>title:<BR><INPUT size=40
          name=title><BR></TD>
        </TR>
          </TBODY>
          <TABLE width="100%" border=0>
           <TBODY>
           <TR>
           <TD align=center><FONT color=#ff0000>* </FONT>Url<BR><INPUT size=40
          name=url value=http://><BR><TD></TR></TBODY></TABLE>
          </TD>
        </TR>
         <TABLE width="100%" border=0>
           <TBODY>
           <TR>
           <TD align=center>description<BR>
           <textarea cols="50" rows="4" name="description"></textarea><BR><TD></TR></TBODY></TABLE>
          </TD>
        </TBODY></TABLE>
        <P style="TEXT-ALIGN: center" align=center><INPUT class=submit type=submit value="add" name=send></TD>
    </FORM>
    and i want make the first 2 fields required ( title and url )

    but i want the user don't leave the form if this 2 fields empty ..

    i want the user don't go to the add.php if this fields empty

    something to making the color of Required fields red if user leave it empty or something .. like :: please fill the blank fields

    so can anyone help me ..
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    follow the link validation

    Comment

    Working...