|
How to check required Form Inputs
|
|
You might want that for some inputs of your form your visitors must always provide a value.
In the following we show how you can check these values with JavaScript.
First a simple example form is presented, then you will see the code on which
the form is based.
|
The code between the script tags is generic in a sense that
it can be applied to any set of inputs (text fields, text areas, radio buttons,
select lists).
You don't have to change the following JavaScript code for using it in your forms.
The only thing you have to change is the argument of the function call in the form
tag, where you specify the names of the required inputs
(require('name1,name2,...')).
|
|
|
|
Here is the code on which this form is based:
|
|
|