Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Button invisible problem

 
payal Jain
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi I am making submit button invisible so as when user enters the data and press "Enter" it should submit the form.
using style="visibility:hidden;"
The problem is when the button is visible,and on pressing "Enter" it submits the form,
but when i make it invisible it dosent submits the form on pressing "Enter".
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I think that's the browser being too smart for its own good.

Try making the button 1 pixel by 1 pixel and white (or whatever your background color is).
 
payal Jain
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks it worked
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haven't seen this behaviour before.

Which web browser exactly was you using? How does the actual form look like?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that this "problem" exists in IE -- a non-displayed submit button is non-functional. I'm not sure about other browsers, but it should be easy enough to test.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Couldn't reproduce this in IE 6.0 and 7.0. Even not with a buttonless form.

Both forms works fine.
 
Stoyan Stefanov
author
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah, if the purpose is just to submit the form without a submit button, simply don't put any button, like in Bauke's first example.

Alternatively, does it work for you if you hide the button with display: none, as opposed to visibility: hidden
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic