javascript input validation

前端 未结 1 791
囚心锁ツ
囚心锁ツ 2021-01-22 10:50

i am using javascript validation for my input box from javascript-coder but i have 2 problems here.

First: The validator in the script uses name to validate the object, i

1条回答
  •  北海茫月
    2021-01-22 11:27

    To answer your second question:

    If validation fails, you want to return false from the submit handler:

    function submitForm() {
        var result = validate(this);
    
        if ( result === false ) { return false; }
    }
    

    That way the form submission process will be canceled.

    0 讨论(0)
提交回复
热议问题