Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 25th, 2005, 10:53 PM
Registered User
 
Join Date: May 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default dropdown question in ASP -- please help!

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>
 
Old June 2nd, 2005, 07:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Do a response.write of request.form("ddlactive") to see what comes everytime you choose something there and submit. So that you can be sure which part of the code gets executed. Post here what you see with response.write

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
Two Level Dynamic DropDown Question workib ASP.NET 3.5 Basics 6 May 14th, 2008 09:18 PM
Two Level Dynamic DropDown List Error Question workib BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 May 3rd, 2008 02:37 AM
Dropdown list question dcct84 C# 4 October 2nd, 2007 02:48 PM
Dropdown list question NeoDelphi C# 3 December 25th, 2004 12:46 AM
Question Re: DropDown box in Windows Form savoym C# 5 March 15th, 2004 09:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.