Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 20th, 2004, 03:52 AM
Authorized User
 
Join Date: Nov 2003
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to get value from check box.....

I am writing a page where i wanted to update one or more records. I'm using check box to determine which record to be update.

but i dont know how to get the check box value and validate all the record under the particular selected field .

e.g. i need to edit record A and B, so i also need to validate all other records under record A and B is not empty.

How can i do this??:(

hope u all can understand.

advanced thanks.



Reply With Quote
  #2 (permalink)  
Old April 22nd, 2004, 05:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Name all the checkboxes with same name with each having the value as the ID/Key field value in your table. When you submit that page, all the values of all check boxes (whichever is checked) are passed under the same name with values separated by COMMA. So you can loop through those values or use them as it is in you update statement depending on the nature of the Update statement.

Eg:
Assume the following records.
KeyVal Name
1 Vijay
2 Cici
3 Planoie
4 Pgtips

If you have Checkboxes named as "chkUpdate" and Value of each checkbox for each record as 1, 2, 3, 4

Then If you have checked only the checkboxes of Vijay and Cici, then on submission to the other page, when retrieved as

Response.write Request.Form("chkUpdate")

will hold value as "1,2"

Then you can split them into an array using SPLIT function.

ArrUpdate = Split(Request(Form("chkUpdate"))

You can use this in Update statement looping through the array values

Start LOOP Based on i
 "Update MyTable Set Name=" & Request.Form("Name") & "Where KeyVal=" & Arr(i)
End LOOP

Note : I have just given you the Pseudocode above there. Syntactically you should make changes as needed.

Hope that helps.

Cheers!

-Vijay G
Reply With Quote
  #3 (permalink)  
Old May 15th, 2004, 08:35 AM
Authorized User
 
Join Date: Nov 2003
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks! I will try it.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
check box help? dstein4d Access VBA 2 February 27th, 2008 09:54 AM
Check BOx kaushikpulpa ASP.NET 2.0 Professional 2 August 30th, 2007 08:01 AM
VBA - Check box KennethMungwira Access VBA 2 May 22nd, 2006 10:43 AM
please help (get check box value) qadeerahmad General .NET 3 September 24th, 2004 08:46 AM
Check box Error surendran BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 July 25th, 2004 11:36 PM



All times are GMT -4. The time now is 09:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.