undefined error on defined variable
<p>it's a simple check and ajax send  function</p>

<p><code>fcell</code> is the cell number and <code>v_cell</code> is the first 3 digits which should be in the 091-3 range .</p>

<p>so i get them both and when i alert them everything is ok (i get 3 alert for each one though )but as it sends the ajax request i get this error </p>

<pre><code>TypeError: fcell is undefined
[Break On This Error]   
var v_cell = fcell.slice(0,3);
</code></pre>

<p>here is the code </p>

<pre><code>var finprog = false;    
    $('.send_to_friend').click(function(){

    var tr     = $(this).parent().parent();
    var p      = $(this).parent();
    var fcell  = tr.find('.fcell').val();
    var fname  = tr.find('.fname').val();
    var funame = tr.find('.funame').val();
    var v_cell = fcell.slice(0,3);
    alert(fcell);
    alert(v_cell);


    if(isNaN(fcell))
    { 
        alert('error');
        return false;
    }

    if(fcell.length != 11 )
    { 
        alert('error');
        return false;
    }

    if(v_cell != 091 &amp;&amp; v_cell != 092 &amp;&amp; v_cell != 093 )
    { 
        alert('error');
        return false;
    }


    if(fname.length == 0 )
    {
        alert('error');
        return false;
    }


    if(funame.length == 0 )
    {
        alert('error');
        return false;
    }

    if(finprog) return false;
    finprog = true ;

    var id  = tr.attr('class');
    p.html('&lt;img src="images/load_square.gif" width="27" height="27" /&gt;');

    $.post('aj.php' , { name:fname , uname:funame , cell:fcell , sms_id:id , doo : 'sent_to_friend' }
     , function(data) { 
     finprog = false;

        if($.trim(data) == 'ok')
        {
            p.html('ok');
        }
        else
        {
            p.html('error');
        }
    })


})
</code></pre>

<p>it doesn't make any sense </p>

<p>here is my ajax parameters . it's defined here ! <code>cell    09163105802</code></p>

<pre><code>Parametersapplication/x-www-form-urlencoded
cell    09163105802
doo sent_to_friend
name    x
sms_id  9
uname   x
</code></pre>
