2
votes

I have two drop down list box . I would like to populate drop down listbox 2 based on selection in drop down listbox 1. Can you please guide me whether this possible in the sharepoint 2007. Both drop down listbox populate from database.

I have created custom list that contains both the drop downbox.

Any help would be highly appreciated.

Thanks,

3

3 Answers

2
votes

By default this is not possible in SharePoint as SharePoint does not give you multi-field validation or rules.

Aside from Calculated fields, you can pretty much consider all fields as having no knowledge of other fields.

However, if you're sure that your users are going to be using the web interface for most of their work then it is possible to use the open source ShUIE (SharePoint User Interface Extender) to achieve what you want.

ShUIE is here: http://shuie.codeplex.com/

It's basically a little utility that allows you to upload JavaScript that gets inserted into SharePoint pages that match some criteria. Oh, and you get jQuery too.

So in your case the "some criteria" is the list upon which your 2 x SELECT lists reside.

And you'd also define the page mode being "NEW" and "EDIT" as those are the two pages that have the form on them.

Then you'd simply write a small piece of jQuery code to say "If both of these fields exist, set an event on SELECT #1 so that when the selected value changes you update/filter the available options on SELECT #2".

And that's it.

So you have a little code to write, but if you're comfortable with JavaScript it's not too bad.

Disclaimer: I wrote ShUIE... but then, this is precisely the scenario I wrote it for.