title: Redirecting to a page after clicking button in a popup
body: <p>I have a link in my web page:</p>
  
  <pre><code> &lt;a class="dropdown-item" href="#" onclick="ChangePasswordPopup();"&gt;Change your password&lt;/a&gt;
  </code></pre>
  
  <p>When this link is clicked, the popup opens defined below:</p>
  
  <pre><code>function ChangePasswordPopup()
  {
      var html=""; // to store the html content
  
      // Build the content of the change password popup form
      html+="&lt;div class='col-md-12 divChangePasswordPopup' id='divChangePasswordPopup'&gt;";
      html+="&lt;div class='divBackground' id='divBackground' onclick='ClosePopup();'&gt;&lt;/div&gt;";
      html+="&lt;div class='panel panel-primary divForeground' id='divForeground'&gt;";
      html+="&lt;div class='panel-heading'&gt;";
      html+="Change your password";
      html+="&lt;a href='#' onclick='ClosePopup();' id='CloseButtonLink' title='close'&gt;";
      html+="&lt;span class='glyphicon glyphicon-remove' style='float: right; font-size: 18px; padding: 3px 3px 0px 0px;'&gt;&lt;/span&gt;";
      html+="&lt;/a&gt;";
      html+="&lt;/div&gt;";
      html+="&lt;div class='panel-body'&gt;";
      html+="&lt;form name='frmChangePassword' onsubmit='ChangePassword(this);'&gt;";   .....form textboxes goes here.....
      html+="&lt;button type='submit' name='btnSave' class='btn btn-primary-outline'";
      html+="style='position: relative; float:right;'&gt;Save Changes &lt;i class='glyphicon glyphicon-chevron-right'&gt;&lt;/i&gt;&lt;/button&gt;";
      html+="&lt;br/&gt;&lt;/div&gt;&lt;/li&gt;&lt;/form&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;";
  
      $("#divChangePasswordPopup").html(html);    
      disablescroll(); // disable the scrollbar for the webpage    
      return(false); // to prevent the calling form from executing    
  }
  </code></pre>
  
  <p>This is working. When I try clicking the save button, I simply want to redirect to another page, so I did this:</p>
  
  <pre><code>function ChangePassword(frm)
  {
      window.location="login.php";
      return(false); // to prevent the calling form from executing
  
  }
  </code></pre>
  
  <p>But it's not working. If I use that same window.location in a normal button on the web page it's working. But when using it in the popup, it's not working. Anyone knows how I can click a button on the popup form and redirect to the login page?</p>
  
  <p><a href="https://jsfiddle.net/Cavali001/ttw5d73f/4/#&amp;togetherjs=BPAUAwtobK" rel="nofollow">the problem in jsfiddle code</a></p>