Previous Message
Next Message

submitting forms via Enter

Sent by David Feldman on 21 September 2005 13:01

I'm creating a number of forms with styled buttons. I've given up on  
both <input> and <button> elements because of the variable-width  
padding IE adds to them (as well as the 1px border IE puts around  
their background images) and am using <a> tags instead, styled with  
CSS and with href="javascript:..." attributes.

The problem is getting the Enter key to submit the form when the  
cursor is in one of its fields. In Firefox it's easy: I just add a  
submit <input> or <button> and hide it with CSS. But IE doesn't like  
that...if the button is hidden the form won't submit. The best I've  
been able to do is leave the button visible and move it way  
offscreen, i.e. position:absolute; top:-2000px; left:-2000px. But  
that's ugly. Any suggestions for a better way?


css-discuss [EMAIL-REMOVED]]
List wiki/FAQ --
Supported by --
Previous Message
Next Message

Message thread: