Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have got two DropDownLists. I want when I set in one value it should change in secound DropDownList the vales. Please Help.

Always the values should look like updated.

share|improve this question
add comment

3 Answers

I would use jQuery for that..

      <input id='dd1' onchange="setval()" />

      <script type="text/javascript">
      Function setval(){
            $("#dd2").val( $("#dd1").val() );
      }
share|improve this answer
add comment
up vote 0 down vote accepted

I do this by ASP.NET. Here is a code :)

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList3.SelectedIndex = (DropDownList1.SelectedIndex-1);
    }

    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        DropDownList1.SelectedIndex = (DropDownList3.SelectedIndex+1);
    }
share|improve this answer
add comment

You can achieve this functionality in SharePoint forms using the SPServices open source library.

The SPCascadeDropdowns function lets you set up cascading dropdowns on SharePoint forms. What this means is that you can enforce hierarchical relationships between column values.

Here's some documentation for it: link


If you just need an ASP.Net way of doing it, then you can do it by updating the datasource of dropdown2 in the dropdown1_OnSelectedIndexChanged server method. Here's an in-depth example for this: link

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.