Guest User

Untitled

a guest
Mar 15th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. $('#login_form :submit').each(
  2. function()
  3. {
  4. var $this = $(this);
  5. var f = this.form;
  6. var link = $('<a class="swap_link" href="#">' + $this.val() + '</a>')
  7. link.click(function()
  8.  
  9. {
  10. $(f).trigger('submit');
  11. return false;
  12. }
  13. )
  14. $this.after(link).css({position:'absolute', top:'-2000px'});
  15. }
  16. )
  17.  
  18. <form id="swaplink" name="login" action="/action/login.php" method="post" accept-charset="utf-8" class="clearfix">
  19. <input type="hidden" name="redirecturl" id="redirecturl" value="{$redirecturl}" />
  20. <h2>My Account Login</h2>
  21. <ul id="login_form">
  22. <li>
  23. <label for="username">Username:</label>
  24. <input type="text" name="username" id="username" class="input-text" maxlength="32" />
  25. </li>
  26. <li>
  27. <label for="password">Password:</label>
  28. <input type="password" name="password" id="password" class="input-text" maxlength="32" />
  29. </li>
  30. <li>
  31. <input type="submit" name="submit" value="Login" />
  32. </li>
  33. </ul>
  34. {$failed_message}
  35. </form>
  36.  
  37. var link = $("<a />").addClass('swapLink')
  38. .atrr('href', '#')
  39. .text( $this.val() )
  40. .onclick( function() {
  41. $(f).trigger('submit');
  42. return false;
  43. });
  44.  
  45. $(f).submit();
  46.  
  47. $('#submit').attr('name', 'stupid_javascript');
Add Comment
Please, Sign In to add comment