Suppress blanks in email

I

im4osu

We have a form that is used to order supplies and set to email once the
user clicks submit. We would like to know if there is a way to have
only the text boxes with data in them included in the email. Our form
has about 120 text boxes which can be completed by the users.
Typically, a user would complete around 30 of them and those are the
only ones we want included in the email. Any ideas?

Thanks for your assistance.
 
P

p c

If you want to use code to do this, test in your processing page to see
the field is empty and leave off if ti is empty.

And if you name all your form fields with consistent names, you can do
do it in a loop. Here's how to do in vbscript code with post submit of
the form. Say you name each textbox tb1, tb2, tb3,..tb120 and you want
to send the emal message as plain text (as opposed to html mail)

strMsgBody= "Message submitted online"& vbcrlf & vbcrlf
For i=1 to 120
strTB="" & trim(request.form("tb"& i))
If strTB<>"" Then
strMsgBody=strMsgBody & "Textbox "& i &": "& strTB & vbcrlf & vbcrlf
End If
Next
strMsgBody= strMsgBody & "Add whatever else you want"

...PC
 
R

Ronx

You will need to use a custom form handler written in whatever language
(ASP, PHP, Perl etc. that your server supports), the FP extensions handler
will send all fields, empty or not.
p c's response outlines one solution that requires ASP.
 

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

Top