Solved

Server-Side VBScript reading checkbox value

Posted on 2009-05-12
10
1,467 Views
Last Modified: 2012-05-06
This is a Classic ASP question concerning using VBScript on the Server Side to return the value of a Checkbox.  

I have a form that creates checkboxes in VBScript code then the page is first rendered. I create a variable number of checkboxes in a do loop (see code)

Essentially the code generates a dynamic number of checkboxes each with a different name, id, & value.  The value is the ID of a table into which I  want to save true/false based on whether the checkbox is checked.  The checkboxes appear to be generated correctly.

Then I post the form in which the checkboxes r located.  I'm able to read values of text boxes using VBScript on Server.

HOWEVER, when I attempt to read the checkboxes on the Server Side using VBScript to process the value of the checkbox.  I use code like

      myVal = Request.Form(strCbxName) .... where strCBXName = "cbx1', "cbx2" ....  

Regardless of the state of the checkbox, I cannot seem to get a value or checked status from the checkbox.  

Any thoughts on what is happening?

Thanks for your help
mynum = 0

Do while not rst1.EOF

   mynum = mynum + 1

   <input type="Checkbox" name="<%='cbx' & mynum%>  id = <%='cbx' & mynum%> value = <% rst1.fields('value') >

Loop

Open in new window

0
Comment
Question by:deepPowdah
  • 6
  • 2
10 Comments
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24365593
here is some nice reading for you.
http://www.w3schools.com/ASP/showasp.asp?filename=demo_checkboxes

Carrzkiss
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24365617
wrong resource.
Give me a minute as I have something that might just help to answer yoru question(s)
0
 
LVL 30

Accepted Solution

by:
Wayne Barron earned 500 total points
ID: 24365646
Here you go.
This is a very good demostration on doing what you are doing.

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8518&lngWId=4

Carrzkiss
0
 

Author Comment

by:deepPowdah
ID: 24365779
First of all your download includes an MS Access database and it is a potential threat.  Also it looks like the code is client side.  I need server side code.

Thanks anyway.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24370928
OK
Do not really appreciate the sarcasm with the link that I provided.
#1: If you do not feel comfortable downloading files with Access database files within them.
Then I suggest that you never download code, because 90% of the ASP code that you
Will download is going to have Access databases included.

#2: The script is "Server Side" not "Client Side"
Where do you get "Client-Side" out of the script that is located in them files?

I think that you need to study the code a little better then you just did.

Good Luck
Carrzkiss
0
 

Author Comment

by:deepPowdah
ID: 24373476
Thanks
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24373543
>> Responses were useless.  Resolved the issue myself
That is totally uncalled for and very unprofessional.
I provided you with the proper information that was needed. http:#24365646
The code from that link has helped out not only myself but many other people that I have
Supplied it to here on EE.

I object to you closing this Question in this manner and with this type of attitude.

Carrzkiss
0
 
LVL 30

Expert Comment

by:Wayne Barron
ID: 24390316
The link that I provided here http:#24365646
Demostrates how to use Dynamically created Checkboxes.
The site that it is downloaded from is recognixed as one of the safest sites out there for
Not allowing any type of things in their archives.
-------
The information that I provided will work for them.
So I reject them closing the question for [Delete/Refund]
And I appose this person's statement of my provided link possibly harming his/her computer.
&
>> Responses were useless.  Resolved the issue myself
This is very unprofessional on his/her part, and my responses were not useless.

I suggest:
Accept: http:#24365646
As it is a very good example of what the person needs to do, to accomplish what they ask for.

(I DO NOT Provide bad potentially dangerous links in my post)
Carrzkiss
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now