Validation with ajax View File


Create View in the ...application/views folder and Call this view with a Controller


I have named this view file as user_add.php.


The Code for user_add.php file is:


 /*** Show Css url 
Show js url ****/


 /******** begining of script


$(document).ready(function() {
    $('#Loading').hide();    
});


function check_username(){


    var username = $("#username").val();
    if(username.length > 0){
        $('#Loading').show();
        $.post("validation_username/check_email_availablity", {
            username: $('#username').val(),
        }, function(response){
            $('#Info').fadeOut();
             $('#Loading').hide();
            setTimeout("finishAjax('Info', '"+escape(response)+"')", 450);
        });
        return false;
    }
}


function finishAjax(id, response){


  $('#'+id).html(unescape(response));
  $('#'+id).fadeIn(1000);



*******/


/****** Body Tag will begin ***/
< Call a form and method will post *****/
User Name
/*** Create a input type username whose name will be username onblur will be return check_username() **/
/****** Creae div tag name Info and end this div tag here ****/
 /***** Create span id Loading and in the tag loader image url will be and span tag will end ***/
/***** End Of form tag ****/
/***** End Of body tag ****/ 

Comments

Popular posts from this blog

371 - Ackermann Functions

Create many folder with one click