0

this function is work but when call that value of return is undifined

            $.fn.check=function (fieldName,fieldValue) {
        $val=$(this).val();
        $.post('proccess.php',{check:'check',fieldName:fieldName,fieldValue:fieldValue},
function (res) {
            if(res=='true')
            {
                return 'true'; // this line is work
            }
            else if(res=='false')
            {
                return 'false';  // this line is work
            }
        })
    };

    //calling function
    $('#register input[name=name]').focusout(
        function () {
            var checked=$(this).check('name',$(this).val());
            //but here  value of checked is undifined
            if(checked==true)
            {
                $(this).next('.checked').text('ok');
            }
            else if(checked==false)
            {
                $(this).next('.checked').text('not ok');
            }
        }
    )

my problem is with $.fn. function dont return string data my country language is not english please dont dislike my post :(

yas17
  • 401
  • 1
  • 3
  • 14

0 Answers0