08-05-2002, 07:40 PM
I'm doing an intranet web site that will require almost constant need of a search device to create SQL statements... there are up to about 5 or 6 arguments that are optional for each search.
It seems that using the combo boxes in asp pages is very tedious.. and there is apparently no way to dynamically create the content in a particular combo box based on the selection from another combo box. The interactivity... well... it seems... sucks.
Perhaps there is a way. Dunno.
I'm also thinking... avoid the confusion and just do an ActiveX control in vb. I can code all the logic there... hit my stored procedures... just do about everything I want.
Anybody have any advice?
08-05-2002, 07:53 PM
I have to admit, the activex control sounds good to me. You might
sure is a lot of work to get it right.
08-05-2002, 07:59 PM
'if the box is checked on the calling form then...
if Request("chk" & strField) = "on" then
'Get the value from the combobox and
'add it to the string
strFilter = _
strFilter & "[Movies].[" & strField & "]=" & _
request("cbo" & strField) & " AND "
'Check these fields
If strFilter <> "" then
'Snip off the last AND statement, enclose it, and then
'store in session cookie
Session("Filter") = "(" & Left(strFilter,Len(strFilter)-5) & ")"
'redirect and apply the filter
'Clear the session cookie
Session("Filter") = ""
'redirect with no filter to apply
So, on the calling form I'd have checkboxes called chkGenre, chkYear, and chkRating. And then comboboxs calld cboGenre, cboYear, and cboRating. The combos have their VALUE properties set to reference the numerical ID fields in the database. If the corresponding checkbox is checked, then the selected VALUE from the combo is added to the filtered SQL statement.
08-05-2002, 09:38 PM
Well... I see... so you are firing an asp page after they click the proper boxes and click the submit button or something.
The main hangup I have is that I don't see a way to capture a combo box after click, or click event. If I could... heck, then I could fire an asp page like that, and dynamically load each box, right? that kind of technique would not be too far from your idea.
The ActiveX is so easy to do because I can do vb so much faster. But the asp script is cleaner.
08-05-2002, 10:27 PM
If you want to submit the combo value upon change, then give this a whirl:<form name=frmTest action="NextPage.asp" method=POST>
<select name=ComboName size=1 onChange="frmTest.submit();" >
<option value="2" SELECTED>Fruit
08-06-2002, 09:29 AM
Remote scripting offers the ability to do this, I found it quite effective for a similar drilldown. It is a bit tricky to get going but well worth the effort for the functionality.
Microsoft MSDN Article:
08-06-2002, 10:41 AM
Thanks for the link.
I printed it out... it was about 15 pages in Word.
Don't know if I can understand it... I'll see what happens.