problem processing asp email

R

Raphael Gluck

Hello,

I am trying to process a form using asp emailing (codnts) and I am having a
little trouble, processing one little part of it.

Basically I have a form on my site, which is going to email the results of
this form ( a feedback form) to my email. So it ask for a name and address
etc.. One important thing I needed to include is a list of items and
products that people would like more information on. This is a series of
checkbox's that are taken from my database.

I am just unsure about when I press the submit button how, I process it, so,
the results of the check box,, and their corresponding product labels are
mailed to my email address.

I have set up the pages to be jargon/template/trash free right now, because
if you do have time to help me, I certainly don't want to trouble you to
trawl thru code that is not necessary.



Ok, the two pages on the site (jargon free) are

http://www.tripakltd.com/contactme.asp

http://www.tripakltd.com/sendemail.asp



both pages in code



http://www.tripakltd.com/contactme.txt

http://www.tripakltd.com/sendemail.txt



Thanks in advance to anyone who can help me.



Raphael
 
S

Steven Burn

'// form your visitor see's......
<input type="checkbox" name="chk1"> Some text

<%
'// fproc.asp
strChk1 = request.form("chk1")
'// whatever else your doing......
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Raphael Gluck

Thanks for that Steven.

I tried that, and it almost works, Almost, because i just have one little
problem, for some odd reason, in the email that gets sent to me, I only see
the first word of every checkbox option. so if one of my products are
"Adhesive Tapes" I just see Customer X wants more info on "Adhesive", and i
dont see the second word, "Tapes".

This is the code, I think, that is giving me this little problem

strBody = strBody & "<br><br><b>Please send me more info on the following
Products: -</b>"
If (Request.Form("chkProdClass")) > "" Then
strBody = strBody & "<br> " & Request.Form("chkProdClass")
End If

I hope you can help me,

Raphael
 
S

Steven Burn

strData = Request.Form("chkProdClass")

If strData <> "" then
strBody = strBody & "<br> " & strData
Else
strBody = strBody
End If

'// in the form
<input type="checkbox" name="chkProdClass" value="Some value"> Some text

Should give you the results okay......

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Raphael Gluck

Sorry to bother you again,
I just tried your new piece of code, but now it doesnt work at all.
Please Excuse my ignorance, but what i have done is created a new Dim
strData then pasted in the If clause

IS there any reason you created the strData? it was working fine before,
(with strBody), the only problem being, only the first word of each
checkbox, was appearing, not the entire phrase.
Does one really have to create a different variable for form data? Because
now, nothing appears at all.

If you want to have a look at the page, in code, it's
www.tripakltd.com/sendemail1.txt

Thanks

Raphael
 
S

Steven Burn

The reason I put strData = request.form........ yada, is simply to keep it
tidy when it comes to the If/Then etc, it's not actually necessary (just
easier than having to keep typing "request.form...... yada yada" each time).

I've just written and tested the following pseudo code and verified it
works......

<%
If request.querystring("s")="" then
%>
<form action="form.asp?s=yes" method="post">
<input type="checkbox" name="chk1" value="Some value"> Some value
<input type="submit" name="submit" value="check it">
</form>
<%
elseif request.querystring("s")="yes" then
if request.form("chk1")="" then
response.write "not checked"
else
response.write request.form("chk1")
end if
end if
%>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Raphael Gluck

Sorry I am completely lost here.
I appreciate you have spent quite a bit of your time in helping me this
morning, but must i make all those changes, just so the second word prints?
If yes, do i simply add all that code, to my form page (i.e not my
processing page, in my case contactme1.asp) ?

Thanks so much

Raphael
 
S

Steven Burn

If your form is in a different page to your processing code then you need
only concern yourself with;
if request.form("chk1")="" then
response.write "not checked"
else
response.write request.form("chk1")
end if

I only wrote the pseudo code as I posted, as I like to keep things in one
page.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Raphael Gluck

Ok, I am so sorry for bothering you.
I am trying all your methods but they were not working.
I said before it was almost done, but now it seems to not work at all.
Basically it's almost working, when the form processes, i see it in the
email, it's just i get the first word of every product, rather than the full
phrase.
Please if you have a moment look at my site www.tripakltd.com/contactme1.asp
, scroll down to the checkboxes, That is the core problem, when the mail is
sent, I only get the first word of each product.

Here's the code, that worked, albeit, just the first word of every checkbox.


strBody = strBody & "<br><br><b>Please send me more info on the following
Products: -</b>"
If (Request.Form("chkProdClass")) > "" Then
strBody = strBody & "<br> " & Request.Form("chkProdClass")
End If

I hope you can solve this for me

Thanks so much
 
B

Bob Lehmann

You need to quote your values
<input name="chkProdClass" type="checkbox" id="chkProdClass" value="Adhesive
Tape Dispensers">

Not
<input name="chkProdClass" type="checkbox" id="chkProdClass" value=Adhesive
Tape Dispensers>

Bob Lehmann
 
R

Raphael Gluck

Hey,
That seems to have solved it, I was tearing my hair out, trying to discern
the differences betwen the two lines, and i had to reread your mail several
times. But thanks, it looks like it's working.
How did the quotation marks make the difference? After all, even without
them, it was still working, well partly?!

Thanks again

Raphael
 
B

Bob Lehmann

Partly working isn't working - kinda like a woman can't be sorta pregnant.

The quotes make a difference because the beginning and end of the value can
be determined.
Would having Adhesive Tape Dispensers and all that follows work better than
just the first word returned?

Bob Lehmann
 
S

Steven Burn

Partly working isn't working - kinda like a woman can't be sorta pregnant.

hehe, you've never been to Newcastle then......? <gg>

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
B

Bob Lehmann

Unfortunately, the Nissan pickup isn't up for the trip from Bozeman,
Montana - USA.

Bob Lehmann
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,252
Latest member
MeredithPl

Latest Threads

Top