Print Page | Close Window

Convertin checkbox to a boolean value

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=8291
Printed Date: 01 April 2026 at 1:14am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Convertin checkbox to a boolean value
Posted By: adnan248999
Subject: Convertin checkbox to a boolean value
Date Posted: 22 December 2003 at 3:48pm

I am having a problem which is really driving me nuts.

I have a login form with a checkbox on whether or not the user wishes to be remembered the name of the checkbox is autologin: <input type="checkbox" name="AutoLogin">

I am trying to convert the checkbox value to a boolean in the form processing page like this:

Dim autolog
autolog = CBool(request.form("AutoLogin")

Now the thing is when the user does not check the box the script works fine but as soon as the box is check the page returns an error. Am I doing something wrong? Can checkboxes be used in this way?



-------------
They call me Bruce Lee



Replies:
Posted By: MorningZ
Date Posted: 22 December 2003 at 3:54pm

You can try:

Dim autolog
autolog = (Request.Form("AutoLogin") <> "")



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: adnan248999
Date Posted: 22 December 2003 at 6:47pm
yea cheers worked great thanx a lot

-------------
They call me Bruce Lee



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