Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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
 
Old September 25th, 2003, 11:24 AM
Authorized User
 
Join Date: Sep 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default retreiving value into checkbox

Newbie question:
I am trying to retrive value from Access DB into a form for updating. All my textboxes retrieve values correctly, but my checkboxes display empty.

My coloumn (say: Toys) contains the value "Yes" when a supplier carries toys and contains no value if they don't carry them.

My code looks like this:
<input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then Response.Write ("checked")%> type="checkbox"> Toys</td>

What am I doing wrong?

Thanks
M
 
Old September 25th, 2003, 01:45 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

It looks to me that you are not retrieving the value from the database, but from the form:

<input name="Toys" value="Yes" <% If Request.Form("Toys") = "Yes" Then Response.Write ("checked")%> type="checkbox">

I guess that Request.Form should be something like MyRecordset("Toys")

If you are using checkboxes, remember that they only return the value when they are checked. They will return the value (Yes in your case) when you provide one, or the word on when you leave out the value altogether.

HtH,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 25th, 2003, 03:03 PM
Authorized User
 
Join Date: Sep 2003
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

YES!! This worked! Thank you sooo much.
 
Old September 25th, 2003, 03:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome ;)

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Retreiving value from InputBox maniatis1 Classic ASP Professional 1 January 4th, 2007 03:36 PM
retreiving data from URL pavanntcs Oracle 1 September 20th, 2006 02:05 AM
Retreiving textbox values from datagrid ashish_26 General .NET 1 October 15th, 2004 11:47 PM
retreiving a recordset with different records pablohoney Classic ASP Databases 3 September 3rd, 2004 02:58 PM





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