Passing dynamic value in custom filter

I have a field in lead module  as type, Which I want to set as a filter in campaign name dropdown.  I want to create custom filter where campaign name pop up box will filter the records based on the value given in type feild.