mercredi 27 juillet 2016

check username exists using ajax

I use this code to check username exists in database before or not. code works good and shows available or taken username. now i want to submit button should be disable when user select username that was taken befor and enable when username available . please guide me how.

$(document).ready(function() {
    $('#username').keyup(function() {
        $.post('adm/chk_uname_avail.php', { 
            uname : changeuser.username.value 
        }, function(result){
            $('#available').html(result);
        })
    })
})

Aucun commentaire:

Enregistrer un commentaire