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 December 25th, 2004, 10:13 AM
XXL XXL is offline
Authorized User
 
Join Date: Dec 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Listbox search

I got this form with 3 options: 1-comedy, 2-action, 3-sf.
I want to select from database the title and dvd nr based on the catagory field (see the 3 options).
How do I do that?
Pls help me

 
Old January 6th, 2005, 07:01 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

<%
'database field value
newval=rs("option")
if newval="comedy" then
sel1="checked"
elseif newval="action" then
sel2="checked"
elseif newval="sf" then
sel3="checked"
end if
<%
<input type="checkbox" <%=sel1%> name="comedy">
<input type="checkbox" <%=sel2%> name="action">
<input type="checkbox" <%=sel3%> name="sf">

surendran
(Anything is Possible)
 
Old January 6th, 2005, 08:52 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

Hi,
 If it is a single selection you can use radio button as follows..

<input type="radio" name="category" value=1>comedy
<input type="checkbox" name="category" value=2>action
<input type="checkbox" name="category" value=3>sf

After submitting the page then get the value as follows..

Dim selectedvalue
selectedvalue = Request.form("category")
after this use the following query..

strSql= "select * from category_table where category_id=" & selectedvalue


Thanks
Suresh












Similar Threads
Thread Thread Starter Forum Replies Last Post
Search button doesn't search Access DB cbones Visual Studio 2008 1 October 27th, 2008 07:36 PM
New text search doesn't preselect search string planoie Visual Studio 2005 0 July 23rd, 2007 06:47 AM
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
I'm back :) Listbox var from listbox MichaelTJ .NET Web Services 2 October 21st, 2003 07:06 PM
Search engine that search through local drive! wenzation Classic ASP Basics 0 August 26th, 2003 09:15 PM





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