Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#login_form :submit').each(
- function()
- {
- var $this = $(this);
- var f = this.form;
- var link = $('<a class="swap_link" href="#">' + $this.val() + '</a>')
- link.click(function()
- {
- $(f).trigger('submit');
- return false;
- }
- )
- $this.after(link).css({position:'absolute', top:'-2000px'});
- }
- )
- <form id="swaplink" name="login" action="/action/login.php" method="post" accept-charset="utf-8" class="clearfix">
- <input type="hidden" name="redirecturl" id="redirecturl" value="{$redirecturl}" />
- <h2>My Account Login</h2>
- <ul id="login_form">
- <li>
- <label for="username">Username:</label>
- <input type="text" name="username" id="username" class="input-text" maxlength="32" />
- </li>
- <li>
- <label for="password">Password:</label>
- <input type="password" name="password" id="password" class="input-text" maxlength="32" />
- </li>
- <li>
- <input type="submit" name="submit" value="Login" />
- </li>
- </ul>
- {$failed_message}
- </form>
- var link = $("<a />").addClass('swapLink')
- .atrr('href', '#')
- .text( $this.val() )
- .onclick( function() {
- $(f).trigger('submit');
- return false;
- });
- $(f).submit();
- $('#submit').attr('name', 'stupid_javascript');
Add Comment
Please, Sign In to add comment