- Verify that the form data is empty?
- Verify that the input is a correct email address?
- Is the verification date entered correctly?
- Verify that the form input is numeric?
Required (or required) items
The following function checks if the user has filled in the required (or required) items in the form. If the required or required options are empty, a warning box will pop up, and the return value of the function will be false, otherwise the return value of the function will be true (meaning there is no problem with the data):
The above function is called when the form is submitted:
HTML Form Example
Name: <input type="text" name="fname">
<input type="submit" value="Submit">
The following function checks if the data entered matches the basic syntax of an email address.
This means that the data entered must include the @ sign and a period (.). Also, @ cannot be the first character of the email address, and at least one dot is required after @: