Skip to main content
Participant
January 29, 2008
Question

Setting options of dropdowns from javascript

  • January 29, 2008
  • 1 reply
  • 237 views
Hi all,

I am new to coldfusion.
I have created a page called demo.cfm.It has a grid table with edit button on each row of grid.
When user wants to edit the values of grid row click on edit opens another page say demo1.cfm.
In demo1.cfm I want to set the values of cliked row in their corresponding fields.
I have two dropdowns. the options of those dropdowns i am passing from demo.cfm page.In demo1.cfm page in dropdown fields i want to set these options.

The dropdowns in demo1.cfm are dynamic dropdowns. second dropdown value is based on first dropdown value.
how can i set the options which I am getting from demo1.cfm as first option in dropdown.

please help me to resolve this issue.

    This topic has been closed for replies.

    1 reply

    Inspiring
    January 29, 2008
    There are two ways.

    <cfselect selected="#variable_goes_here#">

    or

    <select>
    <option value="something"
    <cfif something>selected="selected" </cfif>
    >