title: Function not modifying passed parameter value
body: <p>I have the following function:</p>
  
  <pre><code>function validateField(target, field, field_check) {
              if(target.val().trim().length &gt; 0) {
                  $.ajax({
                      url: '&lt;?php echo $html-&gt;url('/fonykers/validate_',true); ?&gt;'+ field + '/' + target.val(), 
                      dataType: 'json',
                      type: 'POST',
                      success: function(response) {
                          if(!response.ok) {
                              if(target.is('.ok')) {
                                  target.removeClass('ok');
                              }
                              target.addClass('error');
                              error.html(response.msg);
                              error.fadeIn();
                              field_check = false;
                          } else {
                              if(target.is('.error')) {
                                  target.removeClass('error');
                              }
                              target.addClass('ok');
                              alert('voy a asignar true');
                              field_check = true;
                          }
                      },
                          error:function (xhr, ajaxOptions, thrownError){
                              alert(xhr.statusText);
                              alert(thrownError);
                              field_check = false;
                          } 
                  });        
              } else {
                  error.html('You must specify a ' + field);
                  error.fadeIn();
                  target.addClass('error');
                  field_check = false;
              } 
  
          }
  </code></pre>
  
  <p>I use it to validate my form input fields, the target variable es the field itself, for instance: <code>$('#name_field')</code> the 2nd variable es a string specifying the name of the field for instance <code>name</code> as to know what PHP function it's gonna call. The last is a boolean that I use to know wether or now the field is valid or not for instance <code>name_check</code> which I define at the beginning of the scripta and set to false.</p>
  
  <p>My problem is that <code>field_check</code> gets changed in the local scope properly but it never modifies que external variable that has been passed in, what am I doing wrong?</p>