Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Convertin checkbox to a boolean value
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Convertin checkbox to a boolean value

 Post Reply Post Reply
Author
adnan248999 View Drop Down
Newbie
Newbie
Avatar

Joined: 30 November 2003
Location: United Kingdom
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote adnan248999 Quote  Post ReplyReply Direct Link To This Post Topic: Convertin checkbox to a boolean value
    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?

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
adnan248999 View Drop Down
Newbie
Newbie
Avatar

Joined: 30 November 2003
Location: United Kingdom
Status: Offline
Points: 26
Post Options Post Options   Thanks (0) Thanks(0)   Quote adnan248999 Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2003 at 6:47pm
yea cheers worked great thanx a lot
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.