Drupal Answers Asked by vipin p on February 22, 2021
I have built a site using drupal 7.41. I have added the login form by adding this line in my page.tpl.php “print render($page[‘login_container’]);”.
When user click on the login button I want to show a popup with options “yes” and “no”. only when the user choose “yes” he/she should be logged in. I need change the style of this pop up, that’s why I cannot use jquery window.confirm function.
I went through drupal documentations and found about the function confirm_form.
this is what I am trying to do, but not able to.
I created a hook menu and then called the confirm_form fucntion.
But I am not able to call this from the login submit button.
Sounds like some simple Javascript. E.g. by the help of JQuery you could bind a click/submit function on the login-form, show a confirm-window ("Would you really like to log in?") and if this is confirmed, submit login-data (or not).
Such a function could(!) look similar to this:
$('#user-login-form').submit(function(){
var r = confirm("Would you really like to login?");
if (r == true) {
return true; // submit form-data
} else {
return false; // stay on page
}
});
Answered by Hotte Unzensiert Limitiert on February 22, 2021
3 Asked on September 6, 2020 by johntang
1 Asked on September 4, 2020 by vintorg
1 Asked on August 21, 2020 by monkeyuser
2 Asked on August 15, 2020 by kareem
1 Asked on August 4, 2020 by pan-chrono
Get help from others!
Recent Questions
Recent Answers
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP