Skip to main content
Inspiring
September 19, 2013
Answered

select value base on previous select value

  • September 19, 2013
  • 1 reply
  • 767 views

I have 5 select on the form and each one uses different data source from the query like following.

I want to every one data limite by previous dropdown just like department, manager, supervisoe, leader and employees.

If user select the first one department 1 then all the rest dropdown only shows department one managers, supervisors, leaders and employees.

If user select one supervisors than only employee in hos or her group available for the users.

I need pass client, previous value to the server and send back to client the rest of dropdown box.

Any better way to handle this issue?

Your help and information is great appreciated,

Regards,

Iccsi,

  <select name="MyList1" id="MyList1">

  <cfoutput query="Myquery1">

   <option value="#MyQuery1.MyID#">#MyQuery1.Mycode#</option>

  </cfoutput>

  </select>

<select name="MyList2" id="MyList2">

  <cfoutput query="Myquery2">

   <option value="#MyQuery2.MyID#">#MyQuery2.Mycode#</option>

  </cfoutput>

  </select>

<select name="MyList3" id="MyList3">

  <cfoutput query="Myquery3">

   <option value="#MyQuery3.MyID#">#MyQuery3.Mycode#</option>

  </cfoutput>

  </select>

<select name="MyList4" id="MyList4">

  <cfoutput query="Myquery4">

   <option value="#MyQuery4.MyID#">#MyQuery4.Mycode#</option>

  </cfoutput>

  </select>

<select name="MyList5" id="MyList5">

  <cfoutput query="Myquery5">

   <option value="#MyQuery5.MyID#">#MyQuery5.Mycode#</option>

  </cfoutput>

  </select>

    This topic has been closed for replies.
    Correct answer Carl Von Stetten

    You are going to have to do some JavaScript/AJAX work to update the option values for the last four dropdowns.  Using jQuery this isn't terribly difficult, and there are a number of blog posts and jQuery plugins out there to accomplish this.  Try Googling "jQuery chained select".

    -Carl V.

    1 reply

    Carl Von Stetten
    Carl Von StettenCorrect answer
    Legend
    September 19, 2013

    You are going to have to do some JavaScript/AJAX work to update the option values for the last four dropdowns.  Using jQuery this isn't terribly difficult, and there are a number of blog posts and jQuery plugins out there to accomplish this.  Try Googling "jQuery chained select".

    -Carl V.

    iccsiAuthor
    Inspiring
    September 19, 2013

    Thanks a million for the informaiton and help,

    Yes, jQuery chain  Select is what I am looking for,

    Thanks again,

    Regards,

    Iccsi,