Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Using simpleformwebpart to filter a dataview

  Asked By: Deepak    Date: Dec 11    Category: MOSS    Views: 2021

I have a requirement for users to be able to filter a document
library by more than one column. The preferred user interface is to
give the users several dropdown boxes to make their filtering
selections then click a button to open a page with the results - a
dataview webpart displaying the items matching the criteria
selected.

Sounds fairly straightforward right? I was able to do this in
SharePoint 2003 using a form web part to capture the criteria, then
pass the values selected as query string parameters to another page
with a dataview that consumed the query string parameters and used
them as filter criteria. The key to getting this to work for me in
2003 was finding in the source html the form name (usually something
like "ctl04") and the element names (usually something
like "WPQ7select1") so my javascript could find the controls and
capture their values. So I had some code similar to this:

var the form;
theform = document.forms['ctl04'];
varSelect1 = "";

varSelect1 = theform.WPQ7Select1.options
[theform.WQP7Select1.selectedIndex].value;

window.location.href="http://pagename.aspx?P1="+varSelect1;

I'm now trying to get this same functionality to work in a new MOSS
site. I've noticed that the form name is different now -
"aspnetForm", but the part that is stumping me is that the webpart
identifier "WPQ7" seems to change when the page loads. So my filter
might work once then if I reload the page to reset the criteria ti
will stop working, I'll view source and see that the web part is not
WPQ8 instead of WPQ7.

My guess is that due to the differences in MOSS forms I should be
accessing the form elements differently, but I'm not sure how. Any
suggestions?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Using simpleformwebpart to filter a dataview Or get search suggestion and latest updates.