tags:

views:

31

answers:

3

Hi I am using ajax to showing the error message ...I am getting the values in success: function(msgqq) This is my ajax if want to get another response then how to get ex: I want

success: function(msgqq)

and

success: function(msg)

This is my ajax

function UserNameAvailablity(inp)
{

$.ajax({
   type: "GET",
   url: "<?=base_url()?>/system/application/views/ssitAjax.php",
    cache: false,
   data: "txtUserName="+inp,
   success: function(msgqq){
    document.getElementById('showErrmessage').innerHTML=msgqq;
      $("#showErrmessage").html(msgqq);
       if(txtUserName.value =="")
       {
         document.getElementById('txtUserName').focus();
         document.getElementById('txtUserName').value="";
       }

   }
 });
}
+1  A: 

Call function with two parameters

function(msgqq, msg)

Or i think you can call complete function too

complete: function(msg){

But only problem with complete i think is it call even if response is failed.

Salil
+1  A: 

If you want another response then you will have to perform an additional request.

Ignacio Vazquez-Abrams
+1  A: 

call the two functions from the success function.

success: function(){
     callBack1();
     callback2();
  }
Derek Adair