This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes disabled field with selected value Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "disabled field with selected value" Watch "disabled field with selected value" New topic
Author

disabled field with selected value

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 369
If I have a drop down list and user picked an item there, then when user clicks another element on the page, a javasacipt code disable the entire drop down list. So what we see is -- the item user just picked from the drop down list is still highlighted but all the items in the list is grayed out. At this time, if user clicks Submit button, does that selected item get carried over as hidden variable to next page in JSP parameter ?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56201
    
  13

Disabled elements do not participate in form submissions.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
Ben,
To achieve this you can follow one of the two ways mentioned below.

1) Just when you submit the form write a javascript function which will enable all the disabled fields.
2) Assign the values of the disabled parameters to some hidden variables and use these instead of using the actual parameters.

I dont know how good the above mentioned ways are and if there are any better ways than these. I have followed both the above methods when I ran into a similar situation.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: disabled field with selected value
 
Similar Threads
jsp drop down list problem
how to pop up a html page by pressing a button in a java application?
saving preselected drop down value
html:options in struts
How To Dynamically Display the Content of a Page that is Selected from a Menu?