• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

DropDown Disabled.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a drop down , if i make it disabled i can't capture the value in my servlet. There is no option called readOnly for the dropdown. How can i achieve this.

Thanks,
Prasad.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
either you have to enable it right before the form is submitted or place the selected value into a hidden element.

Eric
 
Prasad Tirumareddi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Eric.

But the situation is like this .
The drop downs will be disabled on loading the form depending on the OID Roles / Groups. So sometimes the drop down will be enabled and sometimes not. So i don't know how many drop downs are enabled and how many are not. Making them enabled on submit or validating before submit is like a tedious task. I am looking for a solution by which i can get the values even though they are disabled. Is there any way that cetain style will show the dropdown as disabled but actually not disabled.

Thanks,
Prasad.
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anything you could come up with would be far messier than what Eric has already suggested. Personally, I'd go with the hidden variable solution.
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea hidden fields needs to be used.
 
Prasad Tirumareddi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, i agree with Eric solution.

If i have 20 fields on my page , do you think that 20 hidden variables are to be created. And my pages span more than 20 fields.

I am trying for a better solution. Anyway if i don't i will go with Eric solution. Right now i codded according to Eric.

Thanks,
Prasad.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is you already know when the fields are going to be disabled.
So when you are going to submit the form just change the action attribute of the form by adding all the disabled fields nd their values to the URL.
I know this involves javascript coding to some extent but then you wont need hidden variables.
Since you asked for another option here it is.
If i am wrong guys/gals please correct me.
    Bookmark Topic Watch Topic
  • New Topic