Well, I have the following problem: my little test website is near completion and all that’s left is PHP validation on submit. But there exactly lies my problem. I can’t seem to let it validate when the user clicks submit.
I searched plenty of websites but on all of those they submit the page to the same page, and I submit the page to a new page. I don’t know how different this is from the first method but I can’t seem to get it to work.
I have 5 fields in my form which need to be required:
<table>
<tr>
<td align="right">Naam:</td>
<td align="left"><input type="text" name="naam" onkeydown="return names(event)"/></td>
</tr>
<tr>
<td align="right">Woonplaats:</td>
<td align="left"><input type="text" name="woonplaats" onkeydown="return names(event)"/></td>
</tr>
<tr>
<td align="right">Straatnaam:</td>
<td align="left"><input type="text" name="straatnaam" onkeydown="return names(event)"/></td>
</tr>
<tr>
<td align="right">Huisnummer:</td>
<td align="left"><input type="text" class="formnumbers" name="huisnummer"/></td>
</tr>
<tr>
<td align="right">Telefoonnummer:</td>
<td align="left"><input type="text" name="telefoonnummer" onkeydown="return phonenumber(event)"/></td>
</tr>
</table>
That’s all. My form action is as follows:
<form action="?page=pizza_bestelling" method="post" name="orderform">
I know PHP validation should be really easy (at least that’s what I’ve heard) but I can’t seem to work it out myself, so that’s why I decided to ask it here.
Now all it needs to do is check if one of those 5 fields is empty, if so don’t submit. Otherwise submit.
(Keep in mind that I have 16 fields in my form, it counts only for these 5 specific, the other 11 can be empty)
I appreciate any help in this matter, since it’s all that’s left before completing my website!
Thanks in advance!