Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hidden button is shown in FireFox

 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm using a submit button with width:0px to hide it. In IE it works, but in FF I get a S (of Submit).
Here is the code:

How do I hide this properly?
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
style="visibility:hidden"
or
style="display:none"
[ October 20, 2005: Message edited by: David Ulicny ]
 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. Both of them work.
The only problem is that IE now doesn't execute correctly when I use it.
The hidden button is to give the user the possiblilty to login without pressing login button but by using enter key. Now that is not properly recognized in IE. but thanks for helping me really hide the submit.
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe some javascript could help, the onkeydown event.
 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript not allowed
 
Fred Leclerc
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you cannot use javascript, try replacing your input button by an input of type image. Depending on the visual aspect, the image could be a plain 1px by 1px image matching the background color. I'm pretty shure that if you display:none an submit button, IE won't submit when the enter key is pressed.

I've tested with a simple form, and if you put an input type image instead of a classic submit button, then add the style="cursor: default;".

Worked fine when I tested it .. hope it helped.

Regards.
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
perhaps there's a way around what you are trying to achieve without a hidden button? we may be able to give some alternatives if we know what you're trying to do.
 
Ergin Er
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alan,

The idea is to give the user 2 options to login to the site.
1- by pressing the login button
2- by pressing enter key within password/username field
Both are implemented as a "submit"
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
instead of hidden button, using javascript, you can detect event = '13' for the 'onkeydown' attribute of the password field (user has pressed 'enter') and do form.submit() when that occurs. if you're concerned about JS compatibility issues, i think you'll have that with about 1-5% of the users (unless everyone is using netscape on mac). in those cases, a the 'click on button' option is still available.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic