-1

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.

1

I would use jQuery for that..

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

      <script type="text/javascript">
      Function setval(){
            $("#dd2").val( $("#dd1").val() );
      }
| improve this answer | |
0

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);
    }
| improve this answer | |
0

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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