December 2, 200916 yr Hi guys I'm working on a simple php form and I want to have my form so that if the user doesn't fill in a required input the error message appears below the actual input area and not on a seperate page, is this possible with php alone?
December 2, 200916 yr Hi guys I'm working on a simple php form and I want to have my form so that if the user doesn't fill in a required input the error message appears below the actual input area and not on a seperate page, is this possible with php alone? Yea all you have to do is add the validation code under each field say like for name you would do <input type="text" name="name"> <?php if(!$name){ echo "Please enter your name"; } ?> //Lets try another field like phone <input type="text" name="phone"> <?php if(!$phone){ echo "Please enter your phone"; } ?> Hope this helps some
Create an account or sign in to comment