Need to auto select a select box on postback with user's selection
I have a ColdFusion page with a select drop down list. On submit, I'm storing the value in a cfparam and trying to use jQuery to auto select that particular option. Currently I'm using :contains but this is unacceptable because it selects the last item that contains the cfparam.
$("option:contains('<cfoutput>#form.company_type#</cfoutput>')").attr('selected', 'selected');
Is there something like this:
$("option").equals('<cfoutput>#form.company_type#</cfoutput>')").attr('selected', 'selected');
OR
$("option:equals('<cfoutput>#form.company_type#</cfoutput>')").attr('selected', 'selected');
I willconsider other alternatives to accomplishing my objective.
Noob BTW =)
Thanks in advanced...