Print Page | Close Window

ASP - Access - & Checkboxes?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8986
Printed Date: 01 April 2026 at 12:59am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP - Access - & Checkboxes?
Posted By: Garrett1226
Subject: ASP - Access - & Checkboxes?
Date Posted: 16 January 2004 at 4:32pm

I have an HTML form that posts to an ASP engine updating an Access database.

How do I script for posting the choice made between multiple checkboxed fields to one column in my table?  To be more specific:

This is how I have been updating a text field named contact to a Table column named ContactTime: My recordset is rsCropLeads:

rsCropLeads.Fields("ContactTime") = Request.Form("contact")

On my form I have 4 checkbox fields for different insurance types.  I want the field/fields checked to be entered into my column named "Type" in my access DB.  I tried the following, but, the field in the column remained empty when ran:

rsCropLeads.Fields("Type") = Request.Form("CropHail" + "MPCI" + "CRC" + "Unsure")

Any Ideas?

Thanks



-------------
Garrett Miller



Replies:
Posted By: MadDog
Date Posted: 16 January 2004 at 5:31pm
How is this related to the Forum Support?

-------------
http://www.iportalx.net" rel="nofollow">


Posted By: Semikolon
Date Posted: 16 January 2004 at 5:54pm

this should be posted in the asp forum..

but, i didnt really understand your question



Posted By: dpyers
Date Posted: 16 January 2004 at 7:43pm

request.form brings back a single field and could not find one named "CropHail" + "MPCI" + "CRC" + "Unsure"

Try...

rsCropLeads.Fields("Type") = request.form("CropHail") + request.form("MPCI") + request.form("CRC") + request.form("Unsure")

If none are checked, you'll get a 0.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: ljamal
Date Posted: 16 January 2004 at 7:50pm
Originally posted by MadDog MadDog wrote:

How is this related to the Forum Support?

How is that helpful at all? Just more noise.

Back to the question ....
The best solution to you multiple checkbox would be a multiple choice select. This way you are checking one posted field rather than attempting to append multiple fields together.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: alachig82
Date Posted: 17 January 2004 at 5:15pm

yes, you must used

request(checkbox1 name) & request(checkbox2 name) &...



Posted By: fernan82
Date Posted: 19 January 2004 at 2:42am
Yea, the way you're doing it it's looking for a field called CropHailMPCICRCUnsure so that's why it returns null,

I think the best solution is to name all the checkbox fields the same like:

<input type="checkbox" name="checkboxes" value="1">Checkbox1<br>
<input type="checkbox" name="checkboxes" value="2">Checkbox2<br>
<input type="checkbox" name="checkboxes"  value="3">Checkbox3<br>
<input type="checkbox" name="checkboxes" value="4">Checkbox4<br>

Then use Request.Form("checkboxes"), it will return the values of all the checked fields separated by commas, if you don't want the separated by commas then use:

Replace(Request.form("checkboxes"), ",", "")


-------------
FeRnAN
http://www.danasoft.com/">


Posted By: Garrett1226
Date Posted: 19 January 2004 at 8:28am

Thanks for everyone's help on this issue.  I apologize for posting this question in the wrong section of the forum.

I appreciate how open and helpful members of this forum are.  Makes it easier to learn, understand and develop the skills I use in may day-to-day activities.

Thanks to everyone again.

Garrett



-------------
Garrett Miller



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net