how to use Alertify js on JQuery form validation

89 views Asked by At

im having a problem on how to use the alertify on Jquery form validation. What i want to do is when i click the submit button when there is no input on the form, the error alertify will pop out but i keep getting error. Im newbie in using Jquery. Here is my Jquery code:

$(function(){
var $registerForm = $("#formValidation");
if($registerForm.length){
    $registerForm.validate({
        rules:{
            fname:{
                required: true
            }
        }, 
        messages:{
            fname:{
                required: 'First Name Required'
            }
        }
    })
}

})

It's just one input field as of now because it may be a hassle to put all the input fields on my form. also, this code is running but instead of the message "first name required", I want it to be in alertify. Thank you in advance.

0

There are 0 answers