jobs1109 Posted July 28, 2011 Share Posted July 28, 2011 HI, How can I make sure that this form is filled out correctly and no blank imputs ? Here is the form <table bgcolor="068e0d"> <tr><td style="width: 265px"> Job Title: <span class="style2">*</span></td><td><input type="text" name="Job-Title" style="width: 196px" /><span class="style2"> </span><br><br> </td></tr> <tr><td style="width: 265px"> Company: <span class="style2">*</span></td><td><input type="text" name="Company" style="width: 196px" /><span class="style2"> </span><br><br> <td></td> <tr><td style="width: 265px"> Salary: <span class="style2">*</span></td><td> <input type="text" name="Salary" style="width: 196px" /><br><br> </td></tr> <tr><td style="width: 265px"> Description: <span class="style2">*</span></td><td> <textarea rows="17" cols="50" name="Description" wrap="physical" border="0">Description:</textarea> <br><br> </td></tr> <tr><td style="width: 265px"> Company URL: <span class="style2">*</span></td><td><input type="text" name="Company-URL" style="width: 196px" /><br><br> </td></tr> <tr><td style="width: 265px"> Phone Number: <span class="style2">* </span> </td><td><input type="text" name="Phone-Number" style="width: 196px" /><br><br> </td></tr> <tr><td style="width: 265px"> Address: <span class="style2">*</span></td><td><input type="text" name="Address" style="width: 414px" /><br><br> </td></tr> <tr><td style="width: 265px"> Requirements: <span class="style2">*</span></td><td> <textarea rows="17" cols="50" name="Requirements" wrap="physical">Requirements:</textarea> <br><br> </td></tr> <tr><td style="width: 265px"> Job Category: <span class="style2">*</span></td><td><?php include'Jobs-Category.php'; ?><br><br> </td></tr> <tr><td style="width: 265px"> Job Type: <span class="style2">*</span></td><td><?php include'Job-Type.php'; ?> <br><br> </td></tr> <tr><td colspan="2"> <input type="submit" value="Preview Job" /> <input type="reset" value="Reset"><br> </td></tr> </table> Quote Link to comment https://forums.phpfreaks.com/topic/243071-error-checking-form/ Share on other sites More sharing options...
WebStyles Posted July 28, 2011 Share Posted July 28, 2011 you can use javascript to check if all fields are filled in. Quote Link to comment https://forums.phpfreaks.com/topic/243071-error-checking-form/#findComment-1248508 Share on other sites More sharing options...
Maq Posted July 28, 2011 Share Posted July 28, 2011 You should be checking server side first. After that, you can add JS for user-friendliness. I'll move you to the PHP Coding Help section and after you have that accomplished start a new thread in the JS section for client side checking help. Quote Link to comment https://forums.phpfreaks.com/topic/243071-error-checking-form/#findComment-1248548 Share on other sites More sharing options...
Nodral Posted July 28, 2011 Share Posted July 28, 2011 I tend to use if(strlen($_POST['field 1]>0 AND strlen($_POST['field 2])>0 AND strlen($_POST['field 3])>0 AND .......................... ){ //do something } else { //fields not complete } Quote Link to comment https://forums.phpfreaks.com/topic/243071-error-checking-form/#findComment-1248553 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.