Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript 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
  #1 (permalink)  
Old August 31st, 2004, 07:18 PM
SoC SoC is offline
Authorized User
 
Join Date: Jul 2004
Posts: 65
Thanks: 0
Thanked 0 Times in 0 Posts
Default Form element "memory" - for checkboxes

Howdy,

New to Vbscript - learning as I go.

I want to be able to give form elements "memory".

I have a form which people fill out and submit via CDOMail. I have simple validation on it, and so I want the form elements to retain the users' selections if they have not filled out the form correctly.

I can get this to work easily with text fields/areas and radio buttons using the following method:

Code:
<input type="radio" name="frequency" value="one"
        <%if frequency="one" then response.write("checked")%>>


This does not seem to work with checkboxes though. Does anyone have any ideas how you can make it work with checkboxes?

thanks

S


Reply With Quote
  #2 (permalink)  
Old September 1st, 2004, 04:35 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Checkboxes are only submitted if they are checked, so you can use something like this:
<input type="checkbox" name="your checkbox name"
<% If Not IsEmpty(Request.Form("your checkbox name")) Then Response.Write "checked" End If %>
>
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leak - MDI form? john316 VB.NET 5 September 4th, 2007 02:43 PM
form submission of group of checkboxes of samename neeraj_sharma05 Struts 1 November 13th, 2006 07:31 AM
Getting form element names in a loop crapanz Javascript 5 January 30th, 2006 12:45 AM
file form element nerssi Javascript 3 January 18th, 2005 06:14 AM
Dynamic form checkboxes Claralu Classic ASP Databases 2 August 5th, 2003 12:01 AM





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