Drop Down question

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
SeanTyree
Profound User
Posts: 76
Joined: Fri Jan 11, 2013 6:11 pm
First Name: Sean
Last Name: Tyree
Company Name: US HealthWorks
State / Province: California
Zip / Postal Code: 91355
Country: United States
Contact:

Drop Down question

Post by SeanTyree »

Is there any functionality in the select box widget to support the HTML <option> disabled Attribute as demonstrated here: http://www.w3schools.com/tags/att_option_disabled.asp?

I have a need to include options in a drop down that are no longer active, but the option needs to exist for historical purposes.

Sean
negley
Profound User
Posts: 45
Joined: Tue Mar 11, 2014 2:50 pm
First Name: William
Last Name: Negley
Company Name: Utz Quality Foods
Contact:

Re: Drop Down question

Post by negley »

If there isn't, you could always just Javascript to setup the options onload().

Static
getObj('Dropdown1').innerHTML = '<option value="volvo" disabled>Volvo</option<option value="saab">Saab</option><option value="vw">VW</option><option value="audi">Audi</option>';

Dynamic
Assign RPGVAR to a hidden output character field, 200A; create html options in RPG.
getObj('Dropdown1').innerHTML = get('RPGVAR');

-Bill
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Drop Down question

Post by Scott Klement »

Rather than replace the innerHTML of the DOM element, why not just set it to disabled?

Code: Select all

getObj("TheDropDown").options[3].disabled = true;
It's true that you'd need to use a hidden field (or similar) from RPG to indicate somehow which options to disable, but that shouldn't be too hard if the drop-down is also loaded from RPG.
SeanTyree
Profound User
Posts: 76
Joined: Fri Jan 11, 2013 6:11 pm
First Name: Sean
Last Name: Tyree
Company Name: US HealthWorks
State / Province: California
Zip / Postal Code: 91355
Country: United States
Contact:

Re: Drop Down question

Post by SeanTyree »

Thanks for these suggestions, but the drop-down is loaded via SQL...

I thought there might be some hidden functionality (eg. a hidden second column for disabling options).

Sean
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests