MyBB Community Forums

Full Version: Refine Select Dropdown Option Codes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
May I suggest a little modification in select dropdown code?

Can it be coded like a way that a description appears in the field like "Select one" but is not listed in option fields ...

Why? Because:

Say, the Forum Jump. If you drop it, the first option is "Please Select one". Second option is a separator "-----------". If you click any of the two you will be landed in homepage. There should be the text "please select one" but not as an option in the droplist.

Say, the Moderator Options in Showthread. It has onChange enabled, but default selection is always "Edit / View Thread Notes". So, if you select that option - onChange will not trigger as the value is not being changed, you have to press 'go' just for this option. Rests are all onChange triggered.

Got my point? What I'm suggesting is this way:

[Image: y31lC8B.png]

<select name="action" onchange="$('moderator_options').submit();">
    <option value="" disabled selected style="display:none;">Please Select One</option>
    <option value="1">First Option</option>
    <option value="2">Second Option</option>
    <option value="3">Third Option</option>
</select>

http://jsfiddle.net/effone/XST7R/