title: How to see console output for login form input on click?
body: <p>I have login and signup form and i made HTML form to work by switching between between login and signup. I successfully tried console of signup input data but I am facing problem in Login Form. I am not able to see any input data in console.</p>
  
  <p><a href="https://i.stack.imgur.com/q29Sf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q29Sf.png" alt="CLick here to see my login interface"></a></p>
  
  <p>I have file <code>register.php</code> with below code.</p>
  
  <pre><code>&lt;body&gt;
          &lt;div class="container" style='margin-top:100px;'&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col-sm-12"&gt;
                      &lt;div class="form-wrap"&gt;
                          &lt;div class="tabs"&gt;
                              &lt;h3 class="signup-tab"&gt;&lt;a class="active" href="#signup-tab-content"&gt;Sign Up&lt;/a&gt;&lt;/h3&gt;
                              &lt;h3 class="login-tab"&gt;&lt;a href="#login-tab-content"&gt;Login&lt;/a&gt;&lt;/h3&gt;
                          &lt;/div&gt;&lt;!--a.tabs--&gt;
  
                          &lt;div class="tabs-content"&gt;
                              &lt;div id="signup-tab-content" class="active"&gt;
                                  &lt;form class="signup-form" action="" method="post"&gt;
                                      &lt;input type="email" class="input" name="user_email" autocomplete="off" placeholder="Email"&gt;
                                      &lt;input type="text" class="input" name="user_name" autocomplete="off" placeholder="Username"&gt;
                                      &lt;input type="password" class="input" name="user_pass" autocomplete="off" placeholder="Password"&gt;
                                      &lt;input type="submit" class="button" name="registersubmit" id="registersubmit" value="Sign Up"&gt;
                                  &lt;/form&gt;&lt;!--.login-form--&gt;
                                  &lt;div class="message_box" style="margin:10px 0px;"&gt;&lt;/div&gt;
                                  &lt;div class="help-text"&gt;
                                      &lt;p&gt;By signing up, you agree to our&lt;/p&gt;
                                      &lt;p&gt;&lt;a href="#"&gt;Terms of service&lt;/a&gt;&lt;/p&gt;
                                  &lt;/div&gt;&lt;!--.help-text--&gt;
                              &lt;/div&gt;&lt;!--.signup-tab-content--&gt;
  
                              &lt;div id="login-tab-content"&gt;
                                  &lt;form class="login-form" action="" method="post"&gt;
                                      &lt;input type="email" class="input" name="user_email" autocomplete="off" placeholder="Email"&gt;
                                      &lt;input type="password" class="input" name="user_pass" autocomplete="off" placeholder="Password"&gt;
                                      &lt;input type="checkbox" class="checkbox" id="remember_me"&gt;
                                      &lt;label for="remember_me"&gt;Remember me&lt;/label&gt;
  
                                      &lt;input type="submit" class="button" id="loginsubmit" name="loginsubmit" value="Login"&gt;
                                  &lt;/form&gt;&lt;!--.login-form--&gt;
                                  &lt;div class="message_box" style="margin:10px 0px;"&gt;&lt;/div&gt;
                                  &lt;div class="help-text"&gt;
                                      &lt;p&gt;&lt;a href="#"&gt;Forget your password?&lt;/a&gt;&lt;/p&gt;
                                  &lt;/div&gt;&lt;!--.help-text--&gt;
                              &lt;/div&gt;&lt;!--.login-tab-content--&gt;
                          &lt;/div&gt;&lt;!--.tabs-content--&gt;
                      &lt;/div&gt;&lt;!--.form-wrap--&gt;
  
  
                  &lt;/div&gt;
  
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>ended with script as follows:</p>
  
  <pre><code>&lt;script&gt;
          jQuery(document).ready(function($) {
              tab = $('.tabs h3 a');
  
              tab.on('click', function(event) {
                  event.preventDefault();
                  tab.removeClass('active');
                  $(this).addClass('active');
  
                  tab_content = $(this).attr('href');
                  $('div[id$="tab-content"]').removeClass('active');
                  $(tab_content).addClass('active');
              });
          });
  
  
          &lt;/script&gt;
  
          &lt;script&gt;
              $(document).ready(function() {
  
                 var delay = 2000;
  
                 $('[name="registersubmit"]').click(function(e){
  
                     e.preventDefault();
  
                     var user_name = $('[name="user_name"]').val();
  
                     console.log(user_name);
  
                     if(user_name == ''){
                         $('.message_box').html(
                         '&lt;span style="color:red;"&gt;Enter Your Name!&lt;/span&gt;'
                         );
                         $('[name="user_name"]').focus();
                         return false;
                     }
  
                     var user_email = $('[name="user_email"]').val();
  
                     console.log(user_email);
  
                     if(user_email == ''){
                         $('.message_box').html(
                         '&lt;span style="color:red;"&gt;Enter Email Address!&lt;/span&gt;'
                         );
                         $('[name="user_email"]').focus();
                         return false;
                     }
  
                     if( $('[name="user_email"]').val()!='' ){
                         if( !isValidEmailAddress( $('[name="user_email"]').val() ) ){
                             $('.message_box').html(
                             '&lt;span style="color:red;"&gt;Provided email address is incorrect!&lt;/span&gt;'
                             );
                             $('[name="user_email"]').focus();
                             return false;
                         }
                     }
  
                     var user_pass = $('[name="user_pass"]').val();
  
                     if(user_pass == ''){
                         $('.message_box').html(
                         '&lt;span style="color:red;"&gt;Password cannot be empty!&lt;/span&gt;'
                         );
                         $('[name="user_pass"]').focus();
                            return false;
                     } 
  
                     console.log(user_pass);
  
                     $.ajax
                             ({
                             type: "POST",
                             url: "registersubmit.php",
                             data: "name="+user_name+"&amp;email="+user_email+"&amp;password="+user_pass,
                             beforeSend: function() {
                             $('.message_box').html(
                             '&lt;img src="tenor.gif" width="25" height="25"/&gt;'
                             );
                             }, 
                             success: function(data)
                             {
                             setTimeout(function() {
                             $('.message_box').html(data);
                             }, delay);
                             }
                             });
  
  
  
              });
  
              $('[name="loginsubmit"]').click(function(e){
  
                          e.preventDefault();
  
                      //  var user_name = $('[name="user_name"]').val();
  
                      //   console.log(user_name);
  
                      //   if(user_name == ''){
                      //       $('.message_box').html(
                      //       '&lt;span style="color:red;"&gt;Enter Your Name!&lt;/span&gt;'
                      //       );
                      //       $('[name="user_name"]').focus();
                      //       return false;
                      //   }
  
                         var user_email = $('[name="user_email"]').val();
  
                         console.log(user_email);
  
                         if(user_email == ''){
                             $('.message_box').html(
                             '&lt;span style="color:red;"&gt;Enter Email Address!&lt;/span&gt;'
                             );
                             $('[name="user_email"]').focus();
                             return false;
                         }
  
                         if( $('[name="user_email"]').val()!='' ){
                             if( !isValidEmailAddress( $('[name="user_email"]').val() ) ){
                                 $('.message_box').html(
                                 '&lt;span style="color:red;"&gt;Provided email address is incorrect!&lt;/span&gt;'
                                 );
                                 $('[name="user_email"]').focus();
                                 return false;
                             }
                         }
  
                         var user_pass = $('[name="user_pass"]').val();
  
                         if(user_pass == ''){
                             $('.message_box').html(
                             '&lt;span style="color:red;"&gt;Password cannot be empty!&lt;/span&gt;'
                             );
                             $('[name="user_pass"]').focus();
                                return false;
                         } 
  
                         console.log(user_pass);
  
                          $.ajax({
                                     type: "POST",
                                     url: "loginsubmit.php",
                                  //   data: "name="+user_name+"&amp;email="+user_email+"&amp;password="+user_pass,
                                     data: "email="+user_email+"&amp;password="+user_pass,
                                     beforeSend: function() {
                                     $('.message_box').html(
                                     '&lt;img src="tenor.gif" width="25" height="25"/&gt;'
                                     );
                                     }, 
                                     success: function(data)
                                     {
                                     setTimeout(function() {
                                     $('.message_box').html(data);
                                     }, delay);
                                     }
                                     });
  
  
                      });
  
              });
  
  
              &lt;/script&gt;
              &lt;script&gt;
                  //Email Validation Function 
                  function isValidEmailAddress(emailAddress) {
                      var pattern = /^([a-z\d!#$%&amp;'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&amp;'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
                      return pattern.test(emailAddress);
                  };
              &lt;/script&gt;
  
      &lt;/body&gt;
  </code></pre>
  
  <p>Also i have the code where i will get my login input data and match password and display user dashboard on successful login. Code of <code>loginsubmit.php</code> is as below.</p>
  
  <pre><code>&lt;?php
  
  
  // if ( ($_POST['name']!="") &amp;&amp; ($_POST['email']!="")){
  if ( ($_POST['email']!="")){
  // $name = $_POST['name'];
  $email = $_POST['email'];
  $password = $_POST['password'];
  
  include('connection.php');
  
  //Password Match
  
  $passwordhash = password_hash($password, PASSWORD_BCRYPT);
  
  $query = "SELECT * FROM `tbl_register` WHERE email = '$email' AND  password = '$passwordhash'";
  
  
  
  //PHP code to redirect to dashboard if login successfull else redirect login page
  
  
  
  }
  
  
  
  ?&gt;
  </code></pre>