Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic form / email all fields

Status
Not open for further replies.

jkafer

Technical User
Feb 13, 2004
32
US
Does anyone know if there is a simple way to do the following:

I have a form that is created from a MySQL database.
150 records right now.
So the fields will change.
I would like the field name on the form be the PartNumber.
The field is a text field, so that the user enters a quantity.

Now, the hard part.
I want to email the field name (PartNumber) & value of all fields that are not blank.

If possible, I do not want to have to run through the list of partnumbers from the database. Isn't there a way to send all fields that have a value? I have seen a cgi/perl script that does this, but I can't find it now.
 
for each formField in request.form
if request(formField) <> "" then
mailBody = mailBody & formField & " = " & request(formField) & vbcrlf
end if
next

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
That worked perfect.

Thanks for the quick help!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top