471,066 Members | 1,274 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

How to read in 150 checkbox values and output to email body?

I have a form with 150 checkboxes. Need to send email with the Checked ones usng ASP. But i am unable to figure a simple way to do it. All i can understand is getting their values one by one and creating variables for all of them in the asp file and then put each in the body of the email body.

Please help me with a Simple Solution! If you show me with a Code then it will he highly appreciated.

Thanks in advance..

Aslam
Dec 2 '10 #1

✓ answered by jhardman

You don't need an array, you need a loop like the one I showed in my first response.
Expand|Select|Wrap|Line Numbers
  1. for each x in request.form
  2.    VarBody = varBody & x.name & ": " & x.value & "<br>" & vbnewline
  3. Next
it loops through each item submitted in your form, and adds each to a new line in your mail body.

Jared

9 2610
jhardman
3,406 Expert 2GB
Expand|Select|Wrap|Line Numbers
  1. For each x in request.form
  2.    'Perform some code here for each checkbox such as
  3.    Response.write x.name & ": " & x.value & "<br>" & vbnewline
  4. Next
does this suggest a solution to your problem?

Jared
Dec 2 '10 #2
please make it more simpler.. any short way to handle 170 checkboxes..
Dec 3 '10 #3
jhardman
3,406 Expert 2GB
This is unquestionably the simplest way to do it. Show me the code you use to put one or two checkboxes in an email, and I will show you how to adapt this loop for your code.

Jared
Dec 3 '10 #4
Dim checkbox

checkbox=request.form("checkbox")

varBody = checkbox. bla bla bla

so its a very long process to do it one by one .. so i need the array methods.. that i can learn and use on it and on future work..

thanks
Dec 3 '10 #5
jhardman
3,406 Expert 2GB
You don't need an array, you need a loop like the one I showed in my first response.
Expand|Select|Wrap|Line Numbers
  1. for each x in request.form
  2.    VarBody = varBody & x.name & ": " & x.value & "<br>" & vbnewline
  3. Next
it loops through each item submitted in your form, and adds each to a new line in your mail body.

Jared
Dec 3 '10 #6
so i just have to declare all of them first and then use this loop in the body right!! let me try and get back

so i should name x ( that you used ) as checkbox
Dec 3 '10 #7
jhardman
3,406 Expert 2GB
You don't have to declare anything, the script already has access to the request object. Just loop through it.

Jared
Dec 3 '10 #8
ok thanks i will get back with the results
Dec 3 '10 #9
this is what i am trying to do . .but no results.. error about the saying the Objec Required name
Expand|Select|Wrap|Line Numbers
  1. for each checkbox in request.form 
  2. varbody = "aslam" & varbody & checkbox.name & ": " & checkbox.value & "<br>" & vbnewline
  3. Next 
Dec 5 '10 #10

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by mike | last post: by
16 posts views Thread by TJO | last post: by
2 posts views Thread by William Gower | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.