validateElement
(
field
:
String
,
element
:
HTMLElement
)
:
Promise
| Parameter | Type | Description |
|---|---|---|
field
*
|
String
|
The field name |
element
*
|
HTMLElement
|
The field element |
const
fv
=
FormValidation
.
formValidation
(
document
.
getElementById
(
'demoForm'
)
,
{
...
}
)
;
fv
.
validateElement
(
'userName'
,
userNameEle
)
.
then
(
function
(
status
)
{
// status can be one of the following value
// 'NotValidated': The element is not yet validated
// 'Valid': The element is valid
// 'Invalid': The element is invalid
...
}
)
;
import
{
formValidation
}
from
'/path/to/-validation/cjs/bundle/popular'
;
const
fv
=
formValidation
(
document
.
getElementById
(
'demoForm'
)
,
{
...
}
)
;
fv
.
validateElement
(
'userName'
,
userNameEle
)
.
then
(
function
(
status
)
{
// status can be one of the following value
// 'NotValidated': The element is not yet validated
// 'Valid': The element is valid
// 'Invalid': The element is invalid
...
}
)
;
import
{
formValidation
}
from
'-validation/bundle/popular'
;
const
fv
=
formValidation
(
document
.
getElementById
(
'demoForm'
)
,
{
...
}
)
;
fv
.
validateElement
(
'userName'
,
userNameEle
)
.
then
(
function
(
status
)
{
// status can be one of the following value
// 'NotValidated': The element is not yet validated
// 'Valid': The element is valid
// 'Invalid': The element is invalid
...
}
)
;