Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 7th, 2016, 02:44 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to pass checkbox selected value to Query

Hi,

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

</td>
<td valign="middle" align="center" class="style1">
-- </td>
</tr>
<%
RS.MoveNext
Loop
%>
</table>
<%


End If
RS.Close
SET RS = Nothing
Conn.Close
%>

<%
CompanyID_Merge=Request.Form("CompanyID_Merge")
Conn.Open strConn
SQL = "SELECT"
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?
Reply With Quote
  #2 (permalink)  
Old April 10th, 2016, 09:55 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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

CompanyID_Merge=Request.Form("CompanyID_Merge")

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:

Code:
<% 
if trim(Request.Form("CompanyID_Merge")) <> "" then
	CompanyID_Merge=Request.Form("CompanyID_Merge")
	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)
else
   response.write "There is nothing in the form collection to process...."
end if
%>
__________________
Wind is your friend
Matt
Reply With Quote
Reply


Thread Tools
Display Modes

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

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

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 08:17 AM
deleting records based on selected checkbox lakshmi_annayappa Javascript 3 September 6th, 2007 02:22 AM



All times are GMT -4. The time now is 03:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.