Reply
dropdown question in ASP -- please help!
Old 05-25-2005, 11:50 PM dropdown question in ASP -- please help!
Junior Talker

Posts: 3
Hi, I have a question with dropdown list in ASP. When I click "inactiv" option, the page does not show inactive list. Is there anyone can help me with the code? It has been bothered me for 2 days. Thank you so much. Here is my code:
<%
Dim intActive
intActive = request("ddlactive")

if intActive = "1" then
Set cnnApp = OpenDB()
Set cmdApp = Server.CreateObject("ADODB.Command")
With cmdApp
.ActiveConnection = cnnApp
.CommandType = adCmdStoredProc
.CommandText = "active_list"
Set rstApp = .Execute
End With
else
Set cnnApp = OpenDB()
Set cmdApp = Server.CreateObject("ADODB.Command")
With cmdApp
.ActiveConnection = cnnApp
.CommandType = adCmdStoredProc
.CommandText = "inactive_list"
Set rstApp = .Execute
End With
end if
Set rstApp.ActiveConnection = Nothing
CloseDB cnnApp
Set cmdApp = Nothing
%>
<Script Language=JavaScript>
function validate(thebutton)
{
document.frmapplst.submit();
if (theButton.name=='s1')
document.frmapplst.action='/list.asp?ddlactive='+ document.frmapplst.ddlactive.options[document.frmapplst.ddlactive.selectedIndex].value;
}
</Script>

<FORM NAME="frmapplst" method="post">
Please select: <select name="ddlactive">
<option value="1" >Active</option>
<option value="0" > Inactive</option>
</select>
<input type="button" name="s1" value="Submit" onClick="validate(this)">
</form>
lonestar is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 05-28-2005, 01:01 PM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Would have love to help but sorry can't help.. but u might find help here http://www.webthang.co.uk thats for ASP/ASP.NET Programmers
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.
http://www.smartsoft-ng.com
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-28-2005, 01:29 PM
chrishirst's Avatar
Super Moderator

Posts: 13,526
Location: Blackpool. UK
does it show the inactive list when the page is first loaded ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to dropdown question in ASP -- please help!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11492 seconds with 12 queries