Back Forum Reply New

Dropdown dependent on value of another dropdown

I have two dropdowns, one which selects a number of reports i.e.Code:
lt;spring:bind path=quot;reportForm.selectedSummaryquot;gt;         lt;td gt;  lt;select name=quot;selectedSummaryquot;gt;      lt;c:forEach items=quot;${selectedSummary}quot; var=quot;optquot; gt;          lt;option value=quot;lt;cut value=quot;${opt}quot;/gt;quot;              lt;c:if test=quot;${opt == status.value}quot;gt;selectedlt;/c:ifgt;/gt;              lt;cut value=quot;${opt}quot;/gt;lt;/optiongt;      lt;/c:forEachgt;  lt;/selectgt;         lt;/tdgt;         lt;td width=quot;20%quot;gt;lt;font color=quot;redquot;gt;lt;cut value=quot;${status.errorMessage}quot;/gt;lt;/fontgt;lt;/tdgt;       lt;/spring:bindgt;
Is it possible to configure another dropdown so that it is initially greyed out, but when a valid option from the first dropdown is selected, the second dropdown becomes active and shows its options? I haven't been able to find any examples online yet...

Thanks

I think you are really asking a javascript question.
Do a search for
javascript dropdown dependent
on google

a couple of relevant pages:
jstip22.htm
forum91/4870.htm


Originally Posted by farrellrI think you are really asking a javascript question.

I understand that javascript is required but in the examples shown, it is assumed that the option values are hardcoded, whereas in spring I bind the values upon initialisation to values set in my formbacking object. Would there be a way of parsing these initialised values tp provide a similar logic to:Code:}
if (chosen == quot;1quot;) { selbox.options[selbox.options.length] = new Option('first choice - option one','oneone'); selbox.options[selbox.options.length] = new Option('first choice - option two','onetwo');
}
where 'chosen' is a parameter read from the first dropdown, which is currently an for-loop over a map of values.
¥
Back Forum Reply New