HOW TO add my own (additional) check for fields?

Discuss everything related to JavaScript Auto Form Validator. Questions and requests here.

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

administrator
Site Admin
Site Admin
Posts: 5976
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO add my own (additional) check for fields?

Postby administrator » Dec 7th, '10, 11:05

Sometimes you need to do more complicated check or add your own check for fields.
To do this simply add your own function in following format:

1.

Code: Select all

<script type='text/javascript'>
    function MyCheck(){
        // place here your check .....
        return true; // or false
    }
</script>


2. Add in onclick="return jsFormValidator.onSubmitCheck(.....)

onclick="return MyCheck() && jsFormValidator.onSubmitCheck(.....)
or
onclick="return jsFormValidator.onSubmitCheck(.....) && MyCheck()

depending on priority of your function.

P.S. Take in account that this feature also allows you to write your own check for dependent fields.

Return to “JS Auto Form Validator”