0

I use the plugin of JQuery ValidationEngine and i have "extras" validations for my form. For example: Validate if the AGE of the user is more of 18, If a name of a document already exists in my database (for this use ajax), etc..

Is there a way to create my own functions and call them using the Plugin? Can I call a function ajax with the plugin and show a personal message?

NOTE: I use PHP-Framework CodeIgniter

This is my ajax function

function validatedoc(){
    var doc = $('#doc').val();
    $.ajax({
    url:"panel_control/verify",
    type: 'POST',
    data:{
        doc: doc
    },
    dateType: "html",
    scriptCharset: "utf-8" ,
    async:false,
    success: function (response){
        if(response == 'equals'){
            $('#error_msj').html("Already Exists");
        }
    }
});
}

And already is active validationEngine

$("#form_id").validationEngine();
            $("#form_id").submit(function() {
                if ($("#form_id").validationEngine('validate')) {
                    $.blockUI({ message: "Procesing",
                    css: {
                        border: 'none',
                        padding: '15px',
                        backgroundColor: '#000',
                        '-webkit-border-radius': '10px',
                        '-moz-border-radius': '10px',
                        opacity: .5,
                        color: '#fff'
                    } });
                }
                });

Thanks! :D

user6964
  • 201
  • 3
  • 8
  • 18
  • This has been asked before, after 1 min searching I found [this](http://stackoverflow.com/questions/241145/jquery-validate-plugin-how-to-create-a-simple-custom-rule). You might also want to give [this plugin](http://elclanrs.github.com/jq-idealforms/) a try. – elclanrs Jul 23 '12 at 06:42

1 Answers1

0

Well, I do it with a "funcCall" of the Jquery ValidationEngine.

This, call a external function on my script that realize my custom validation. :D

user6964
  • 201
  • 3
  • 8
  • 18