Wrox Programmer Forums
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 April 7th, 2016, 02:44 AM
Registered User
Join Date: Apr 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to pass checkbox selected value to Query


my code details is below
Do Until RS.EOF%>
<td valign="middle" align="center" class="style1">
<input type="checkbox" name="CompanyID_Merge" value="<%=(RS("CompanyID"))%>" onchange="checkboxlimit();" />

<td valign="middle" align="center" class="style1">
-- </td>

End If
SET RS = Nothing

Conn.Open strConn
SQL = SQL & " Projects.CompanyID, Projects.ProjectID, Projects.ProjectName, Projects.SeasonYear, Seasons.Season, Activities.ActivityName,"
------------------ SQL = SQL & " WHERE Projects.CompanyID = " & CheckNumber(CompanyID_Merge)
SET RS = Conn.Execute(SQL)

I am getting CompnayID_Merge value is null only. I need to pass that checkbox value to above query. I am struggling from past one week.
can somebody please find out what I did wrong?
Old April 10th, 2016, 09:55 PM
Friend of Wrox
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41

Where is your form? You need to post a form to the page to all this to work:


without a form this can not work. You need a form tag, submit button. Then move your ASP to the top of the page and check of the form collection has a value e.g:

if trim(Request.Form("CompanyID_Merge")) <> "" then
	Conn.Open strConn
	SQL  = "SELECT Projects.CompanyID, Projects.ProjectID, Projects.ProjectName, Projects.SeasonYear, Seasons.Season, " & _
	"Activities.ActivityName WHERE Projects.CompanyID = " & CheckNumber(CompanyID_Merge) & ";"
    SET RS = Conn.Execute(SQL)
   response.write "There is nothing in the form collection to process...."
end if
Wind is your friend

Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox control does not pass the selected value when clicked flashmanTom ASP.NET 2.0 Professional 3 May 21st, 2012 06:00 AM
using js to pass selected checkbox values yasinirshad .NET Framework 1.x 0 June 3rd, 2008 02:42 AM
How to pass gridview selected row msbsam ASP.NET 2.0 Basics 1 March 4th, 2008 09:17 AM
deleting records based on selected checkbox lakshmi_annayappa Javascript 3 September 6th, 2007 02:22 AM

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