This topic is locked

Need Drop down

7/31/2008 8:01:37 AM
ASPRunnerPro General questions
S
sfhussain author

HI,
I like this application very much but i am unable to figure out how to make a Drop Down or Filter which contain fields.
If i select any value from Drop down it filters the data with the selected value
Example:
I have Field1 = Zone contain Zone A, Zone B, Zone C
If i select Zone B, All records from Zone B in list.asp will display.
I need drop down here:

J
Jane 7/31/2008

Hi,
use custom event (Insert ASP code snippet option on the Visual Editor tab) to create dropdown on the list page.

Here is a sample:

str = ""

str = "<select onChange=""java script: document.location='tablename_list.asp?a=search&value=1&SearchOption=Contains&SearchField=FieldName&SearchFor='+this.options[this.selectedIndex].value;"">"

str = str & "<option value="">Please select</option>"
strSQL = "select FieldName from TableName"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open strSQL,dbConnection
while not rstmp.eof

str = str & "<option value=""" & rstmp("FieldName") & """>" & rstmp("FieldName") & "</option>"

rstmp.MoveNext

wend
rstmp.close

set rstmp=nothing
str = str & "</select>"

Response.write str

S
sfhussain author 7/31/2008

Hi,

use custom event (Insert ASP code snippet option on the Visual Editor tab) to create dropdown on the list page.

Here is a sample:


Thanks Jane for prompt reply. Can you please tell me how to create multiple drop downs? Do i paste this code multiple time in ASP snippet? and how do i assing the area of display drop down menu?

J
Jane 8/1/2008

Hi,
I'm not sure taht I understand you correctly.

What does "multiple drop downs" mean?
Regarding the second question.

You can add your custom event in any place you want.

S
sfhussain author 8/1/2008

I mean to say that i want to use two or more then drop down in a row with multiple fields.
can you please tell me deatil info how to implement event with asp snippet. i am confused about it:s

S
sfhussain author 8/1/2008

HI Jane,
i am having this error while place an event in List page.
ASP error happened

Technical information

Error number -2147467259

Error description

URL /south_list.asp

SQL query select zone from south
TableName: "south"

FieldName: "zone"
and here is my code what i have placed in Event ListOnLoad

str = ""

str = "<select onChange=""java script: document.location='south_list.asp?a=search&value=1&SearchFor=c&SearchOption=Contains&SearchField=zone&SearchFor='+this.options[this.selectedIndex].value;"">"

str = str & "<option value="">Please select</option>"
strSQL = "select zone from south"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open strSQL,dbConnection
while not rstmp.eof

str = str & "<option value=""" & rstmp("zone") & """>" & rstmp("zone") & "</option>"

rstmp.MoveNext

wend
rstmp.close

set rstmp=nothing
str = str & "</select>"

Response.write str


Kindly help!

J
Jane 8/1/2008

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

S
sfhussain author 8/1/2008

It's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.



Dear Jane,
I am not able to publish this project as demo becuase i dont have any hosting right now, I use this for my local accessgin of users. So how do i publish.
Can youplease give me the code with the Tablename and FieldName as i mention above. and also tell me in which section of Events i should use this code.
ListOnLoad

ListPage: Before Process
etc etc

J
Jane 8/1/2008

Hi,
to publish your project on Demo Account click on the Demo Account button on the last tab.

You need to use following code in teh custom event. To create custom event use Insert ASP code snippet option on the Visual Editor tab.

S
sfhussain author 8/1/2008

Thanks Jane for help,
Well i have uploaded the Demo and my email address is sfhussain@cyber.net.pk.

J
Jane 8/1/2008

Send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

S
sfhussain author 8/1/2008

Jane,

After a long wait of email, i didnt get any confirmation email by which i can activate the demo account. what i do now?