Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

check input of html forms befor sending it to next page

Featured Replies

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

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 by Wickham

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.