title: jquery cant get value of text box
body: <p>i am building one form with fancy box, form work fine but i could not get value from text box.</p>
  
  <p>my java script is</p>
  
  <pre><code>$(function () {
      $("#button").click(function () {
          var yourName = $("input#yourName").val();
          alert(yourName);
          if (yourName == "") {
              $('input#yourName').css({
                  backgroundColor: "#F90"
              });
              $("input#yourName").focus();
              return false;
          }
  
          $.ajax({
              type: "POST",
              url: "bin/form1.php",
              data: $("#login_form").serialize(),
              context: document.body,
              success: function (res) {
                  var success = '&lt;?php echo sprintf(_m('Success name % s '), "" ); ?&gt;';
                  success = success.replace(/^\s*|\s*$/g, "");
                  var RegularExpression = new RegExp(success);
  
                  if (RegularExpression.test(res)) {
                      alert('Message Sent');
                      $.fancybox.close();
                  } else {
                      alert('Error While processing');
                  }
              },
          });
          return false;
      });
  });
  </code></pre>
  
  <p>now my html is</p>
  
  <pre><code>&lt;div style="display:none; height:450px"&gt;
      &lt;form id="login_form" action=""&gt;
          &lt;p id="login_error"&gt;
              Please, enter data
          &lt;/p&gt;
          &lt;input type="hidden" name="action" value="send_friend_post" /&gt;
          &lt;label for="yourName" style="margin-right:110px;"&gt;
              &lt;?php _e( 'Your name', 'newcorp') ; ?&gt;
          &lt;/label&gt;
          &lt;input id="yourName" type="text" name="yourName" value="" class="text_new " /&gt;
          &lt;br/&gt;
          &lt;input type="submit" value="Submit" id="button" class="text_new" style="background:#930; color:#FFF; width:250px; margin-left:170px" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>i am opening this fancy box popup from</p>
  
  <pre><code>&lt;a id="tip5" title="" href="#login_form"&gt;&lt;?php echo "Login" ; ?&gt;&lt;/a&gt;
  </code></pre>
  
  <p>every thing work fine but i can't get value of <code>yourName</code> even alert is showing blank.</p>
  
  <p>Thanks</p>