Hello. I have a form where some of the field names are generated based on
the name of files. This form is being sent via email, and therefore, an ASP
page is handling the mailing, etc. This is going to be hard to explain. This
system is for ordering photos where the user can select an image, select the
size, and type the quantity. When done, the user will submit the information
which is emailed. There are wallet size, 4x5, 5x7, etc.
I'm having trouble with a piece of code regarding the variables. I'm using
the filesystem object to generate a listing of files in a directory, and
then, based on the type of photo, will check to see if a quantity has been
entered, and then output the size, with the image name, along with the
quantity ordered.
So, for example, the form will create a field with a name of
"Wallets002.jpg" which is for wallet size of image name 002.jpg. In order
for me to test to see if the field has a value in it, I'm first creating a
variable that will contain a value that is the same as what was generated by
form:
'Create a variable that has the name of the field from the form.
strImageName is in a loop using the filesystem object to grab the name of
the first file. Prepend it with the size of the photo.
strFieldValueWallets = "Wallets" & strImageName
'Check to see of the field is empty
If NOT IsEmpty(Request.Form("" & strFieldValueWallets & "")) Then
Mailer.BodyText = "Wallet Size of image: " & strImageName
Mailer.BodyText = "Quantity: " & Request.Form("" &
strFieldValueWallets & ""))
End If
I then go on to do the same thing, but check for the 4x5 size, then 5x7,
etc.
Is this kosher? Is the variable strFieldValueWallets created totally
separate from the Request.Form("" & strFieldValueWallets & ""))? I can get
it to display the value placed in the field, but I can't get it to ignore
the field if it has no value in it. (because I'm assuming that the variable
is making it think it has a value in it).
Hope this makes sense. Thank you for any input! Thanks for listening.
Doug