Submit button on login form not working
Permalink
I have a login block in the footer of my website:
http://creativeinterventions.net/newsite/...
If I enter my login credentials and hit ENTER it works. However, if I try and use the GO button, it doesn't. Here's the code on the block's view.php
<div class="loginButton">
<?php echo $form->submit('submit', t('Sign In') . ' >')?>
</div>
Any thoughts as to why this isn't working?
Thanks.
http://creativeinterventions.net/newsite/...
If I enter my login credentials and hit ENTER it works. However, if I try and use the GO button, it doesn't. Here's the code on the block's view.php
<div class="loginButton">
<?php echo $form->submit('submit', t('Sign In') . ' >')?>
</div>
Any thoughts as to why this isn't working?
Thanks.
Thanks for the reply. However, I think you misunderstood. The button to submit the form is not working.
It's a css problem, the text-indent you have applied to #footer .loginButton{ -9999px; } moves the "actual button" off the screen. So when you click on the space you are clicking the div, not the button. To click the button, move your mouse 9999 pixels left. See the problem? In an inspector like Chrome, if you remove that text-indent the normal button moves into place there, and you can click on it and it works as you would expect.
You'll have to come up with another way to use your custom button design. You basically have 2 options, either style the button with your custom background image and override the various regular default css OR what might be easier for you in this case is use jquery.submit() inside a jquery.click(). Attach the click event to the click on that div, then just submit your form using jquery submit. That way you don't have to mess with the button styling and you can keep the text-indent the way it is, because it does look fine aside from the click not working.
You can try the code below it's untested so there may be some error in it but that's the idea, wrap a submit fire on the form inside a click event:
You'll have to come up with another way to use your custom button design. You basically have 2 options, either style the button with your custom background image and override the various regular default css OR what might be easier for you in this case is use jquery.submit() inside a jquery.click(). Attach the click event to the click on that div, then just submit your form using jquery submit. That way you don't have to mess with the button styling and you can keep the text-indent the way it is, because it does look fine aside from the click not working.
You can try the code below it's untested so there may be some error in it but that's the idea, wrap a submit fire on the form inside a click event:
$('form.login_block_form').click( function() { $(this).submit(); // fire form submit }
Thanks for the detailed answer. Any interest in being hired to take care of this for me?
Maybe u need