Introduction: The form verification function can be realized through HTML without writing a JS program, and can support multiple conditional verification of one form unit.
It has nothing to do with server programs, it is completely client-side.
How to use: Add onsubmit="return validator(this)" to the form to be validated
Set in the table unit to be verified, valid (verification rules), errmsg (prompt message), multiple verifications are all separated!
Verification rule parameters:
required Required
isEmail must be in Email format
Is the comparison value of eqaul and another component the same? The comparison component name is added to the component and the attribute eqaulName
Is the comparison value between gt and another component greater than the value of another component? The comparison component name is added to the component and the attribute eqaulName
Is it Number?
Is it plastic surgery?
Is isTime a time format
isDate isDate is the date format
The next version will add content, custom message prompt method, and custom callback function.
Local packaged file download
It has nothing to do with server programs, it is completely client-side.
How to use: Add onsubmit="return validator(this)" to the form to be validated
Set in the table unit to be verified, valid (verification rules), errmsg (prompt message), multiple verifications are all separated!
Verification rule parameters:
Copy the codeThe code is as follows:
required Required
isEmail must be in Email format
Is the comparison value of eqaul and another component the same? The comparison component name is added to the component and the attribute eqaulName
Is the comparison value between gt and another component greater than the value of another component? The comparison component name is added to the component and the attribute eqaulName
Is it Number?
Is it plastic surgery?
Is isTime a time format
isDate isDate is the date format
Local packaged file download