wincode
03-28-2010, 03:37 PM
Hello. I'm trying to make a really simple contact form.
I have name and a content box and with a submit button. When the user presses submit, the form action goes to /page.php?done=1 and then the form gets sent. But I am getting a lot of empty fields. How can I make it so if the user doesn't fill one of the fields, it give them an error and they have to go back to fill it.
Here is my code:
<?php if($_GET['done'] == 1)
{
echo "<center>Thank you for your message. We will have a new site shortly.</center>";}
//BLAH BLAH SEND CODES
else
{
?>
<center>
<form id="contact" name="contact" method="post" action="?done=1">
<br/>Name: <input type="text" name="name"/>
<br/><br/>What would you like on the new site?
<br/><textarea name="content" cols="75" rows="4"></textarea>
<br/><input type="SUBMIT" value="Submit"/>
</center>
<? } ?>
I have name and a content box and with a submit button. When the user presses submit, the form action goes to /page.php?done=1 and then the form gets sent. But I am getting a lot of empty fields. How can I make it so if the user doesn't fill one of the fields, it give them an error and they have to go back to fill it.
Here is my code:
<?php if($_GET['done'] == 1)
{
echo "<center>Thank you for your message. We will have a new site shortly.</center>";}
//BLAH BLAH SEND CODES
else
{
?>
<center>
<form id="contact" name="contact" method="post" action="?done=1">
<br/>Name: <input type="text" name="name"/>
<br/><br/>What would you like on the new site?
<br/><textarea name="content" cols="75" rows="4"></textarea>
<br/><input type="SUBMIT" value="Submit"/>
</center>
<? } ?>