srinivasa Posted March 26, 2010 Report Share Posted March 26, 2010 (question)Create a web page with four text boxes and a button. When user enters all the data and hits the submit button. Display the data entered by the user. If the user has not entered all four text boxes, prompt user to enter values for all four fields. how to promt user to enter correct value? is there any prompt box function in php as there in javascript? giv me solution(code) thanks in advance................... Quote Link to comment Share on other sites More sharing options...
Wickham Posted March 26, 2010 Report Share Posted March 26, 2010 (edited) That's a job for PHP but the code could get quite complicated. It's common for web forms to check if input boxes have been filled in correctly, but showing the result on the same page is an extra piece of coding because web forms are normally submitted to an email or database. Here's an example with two boxes so you could repeat for four boxes:- http://www.wickham43.net/form1.php Edited March 26, 2010 by Wickham Quote Link to comment Share on other sites More sharing options...
krillz Posted March 26, 2010 Report Share Posted March 26, 2010 Javascript = before the data is sent to the server PHP = when the data has been sent. So use javascript to make the interaction better for the user, but use PHP to validate again and if somethings wrong you could display the form again along with let say a somewhat red box telling the user where they didn't fill it out correctly. Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.