Gray-out a dropdown menu

Feb 17, 2010 at 9:37 AM

Hello !

I got 2 drop-down menus : "Normal type" and "Exceptional type", I want to do this :

If I select "None" in "Normal type" drop down then "Exceptional type" is not gray-out and if I don't choose "None" then "Exceptional" is gray-out

and there is the same operation for "Exceptional type" if I choose "None".

Is it possible to do that with your library ??

Thanks in advance !! :-)

Coordinator
Feb 17, 2010 at 4:53 PM

Are you using the SPServices library to drive the content of either of these dropdowns, or are you purely looking for a method to grey out/not grey out?

Coordinator
Mar 1, 2010 at 8:54 PM

LeSanglier:

Did you solve this?

M.

Mar 2, 2010 at 2:03 PM

Finally, I use a simple javascript code :

http://ardenne-informatique.com/~nekrofage/journal/2010/02/19/grisergray-out-un-menu-deroulant-lors-dune-selection/

Sorry, it is in french but easy to understand in english.

Coordinator
Mar 2, 2010 at 4:03 PM

I know enough French to be dangerous.  ;+) That looks like a perfectly good solution for your needs.  Glad it worked for you.

M.

Coordinator
Mar 2, 2010 at 6:06 PM

Your other alternative would be some simple jQuery to disable/enable the field based on an analysis called on a change event.

Mar 3, 2010 at 8:52 AM
webdes03 wrote:

Your other alternative would be some simple jQuery to disable/enable the field based on an analysis called on a change event.

Yes, It is my first idea but my colleague say to me the solution is too heavy for this simple problem.

Coordinator
Mar 3, 2010 at 1:55 PM

I guess it all depends whether you've already got jQuery loaded into the page or not. If it's already there, then there's no reason not to do this with jQuery, as IMHO the code will be more maintainable.  Even if jQuery *isn't* already in the page, one could argue for it.

M.