Hoggy Posted June 4, 2008 Share Posted June 4, 2008 Hi all! Im having a bit of trouble inserting an error message to stop a user from carrying on after not filling in a text field. I havent a clue what the code is to do it but this is what I want to make mandatory: <p> <label for="userid" class ="fixed_required"> User ID: </label> <input type="text" name="userid" id="userid" value = " <?php if(isset($_POST['userid'])) echo $_POST['userid']; ?> "/> </p> I want to make sure that a user has to have all fields filled in before they submit it and if they dont, have an error message pop up telling them to fill in required fields or something along those lines. Can anyone help me please? Link to comment https://forums.phpfreaks.com/topic/108714-inserting-error-messages/ Share on other sites More sharing options...
MatthewJ Posted June 4, 2008 Share Posted June 4, 2008 If you want to do it client side, check this link http://www.w3schools.com/js/js_form_validation.asp or to do it server side http://www.onlamp.com/pub/a/php/2004/04/22/php_css_forms.html Link to comment https://forums.phpfreaks.com/topic/108714-inserting-error-messages/#findComment-557500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.