November 18, 201114 yr how can I check input of forms in my html page before I send it to next page and also I want to put If , like I have 10 value and it should be between 0 and 20 and not be empty or the if can be in the next page which is php page even if write with java
November 19, 201114 yr We can't answer very easily without seeing your code and what you have achieved so far, but you will probably have to build in code similar to the following into your PHP coding:- if($value > 20) {echo "<p>Value must be not be more than 20. Use your back button to try again.</p>"; } elseif($value < 1) {echo "<p>Value must be 1 or more. Use your back button to try again.</p>"; } elseif(empty($_POST['value'])) {echo "<p>Nothing entered. Value must be between 1 and 20 inclusive. Use your back button to try again.</p>"; } } You may also need to check that entries like 02 are converted to 2 and that decimal points and other characters are excluded. See a very simple tutorial here http://www.wickham43.net/form1.php which includes some other checks. Edited November 19, 201114 yr by Wickham
Create an account or sign in to comment