vanillaforums/Garden — Issue #1283: Vanilla Forum - Disabling drop-down with selected option interpreted as 'no selection'
Author: BeyMelamed
Created: 2011-12-27 23:44:52+00:00
State: open

This was encountered in a plugin created on a locally hosted VF (wamp), Win7, 32 bit (noticed also on 64 bit) machine.
For this plugin, i needed to selectively disable the Category drop down in the New Discussion page (as well as Edit Discussion page) so users will not be able to change the pre-selected value.
Using jQuery, i disabled the Category dropdown by adding the "disabled" property with value of "disabled".
This worked fine, the dropdown appeared and behaved disabled with the appropriate option displayed in the field.
However, upon saving the New Discussion, the value actually assigned to the discussion's category was the root category.
I, therefore, assume that VF Post Controller interpreted the state of the drop-down incorrectly and assigned a default value.
I did NOT explore whether the form's Values were affected 'behind the scene' to remove the Category code as a Category item was displayed properly following the disablement of the dropdown.