File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CSS for dropdown and textbox

 
sudharshan tettu
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a scenrio like
in disabled state of the page the drop down should look like a text box with the value populated when hit on edit and the page gets enabled then it should be visible like a normal
dropdown
Is there anyway to achieve this using css. Can we define a style sheet using and make dropdown look like textbox in disabled state

anyhelp greatly appreciated
Thanks
Sudharsan
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason you do not set the textbox to be actually disabled is?

Eric
 
sudharshan tettu
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No you havenot got the problem correctly.

On the page its actually a select box. and in disabled mode. but it needs to be visible like a text box

my requirement is , is there anyway applying styles we can make a dropdown appear as a text?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want the user to be able to look at the options? weird...

Well you will not be able to get it to look exactly disabled, but something like:




If you want it to be exactly like a textbox, than make it a textbox. When it is in the "edit mode", than hide the textbox and show the select element.

Eric
 
sudharshan tettu
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks eric for your reply....

i thought of toggling between text and select but i have around 40 dropdowns per page......

or else is there anyway of changing font properties when select box is disabled.
I mean the client complains when select is disabled , text in it is not legible
is there anyway to make it appear Bold or turn the greyed out font inside select box to black or anyother color

Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not style a disabled element, you can style a readOnly element.

Eric
 
sudharshan tettu
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh ok
then is that possible to do the other way , to make readonly seelct to appear as a disabled and make that back ground appear grayed out like when disabled...
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sudarsan tettu wrote:oh ok
then is that possible to do the other way , to make readonly seelct to appear as a disabled and make that back ground appear grayed out like when disabled...


Try it. Use basic css and see what happens.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic