Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

form returns too much info


  • Please log in to reply
7 replies to this topic

#1 theweave

theweave

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:15 PM

Posted 25 August 2009 - 11:11 AM

I have a client that I made an email form for....it has quantity boxes next to items people would order (yes, I know a store would be better, but this is what client wants)...anyway, I prefilled those with 0 in the quantity to make the name of the item show next to the quantity ordered....trouble is, client only wants items that someone actually orders to show up, not all 50 of her items with 0 next to them where she has to hunt to locate quantity ordered. It's got to be something simple that can be added to the code to only send those with something not 0 in the quanitity, but I'm not schooled enough in forms....I made an existing one work this way for her and banging my head here.
Anyone with a suggestion.....sample below of code for the form...


tempemail=Request.Form("Email")
if(Request.Form("Email") <> "") then
Set Mailer2 = Server.CreateObject("SMTPsvg.Mailer")
Mailer2.ContentType = "text/html"
Mailer2.RemoteHost = "mail.sample.com"
Mailer2.FromName = "Water Order Form"
Mailer2.FromAddress= tempemail
Mailer2.AddRecipient "Website Order", "order@sample.com"
Mailer2.AddCC "Ed Perks", "edperks@sample.com"
Mailer2.Subject = "Water Website Order Form"
Mailer2.BodyText = "<html><body><b>Website Order:</b>" & "<br>" & "<br>" & "Name: " &Request.Form("name") & "<br>" & "Account Number: " &Request.Form("Account Number") & "<br>" & "Address: " &Request.Form("Address") & "<br>" & "City State Zip: " &Request.Form("CityStateZip") & "<br>" & "Phone: " &Request.Form("Phone") & "<br>" & "Contact Person: " &Request.Form("ContactPerson") & "<br>" & "Email: " &Request.Form("email") & "<br> <br><b><br> Coffee </b><hr> " & "Great Lakes Premium Gold Blend: " &Request.Form("Great Lakes Premium Gold Blend") & "<br>" & "Great Lakes Columbian Blend: " &Request.Form("Great Lakes Columbian Blend")..........................

BC AdBot (Login to Remove)

 


#2 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:15 PM

Posted 25 August 2009 - 01:29 PM

Yes. Your javascript needs to check the quantity. If it is greater than zero, then add it to the string representing the message. That is called string concatenation.

#3 theweave

theweave
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:15 PM

Posted 26 August 2009 - 02:27 PM

would you have an example of code needed???

#4 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:15 PM

Posted 26 August 2009 - 04:06 PM

Umm. no, but judging by the sophistication of the code you provided, creating it on your own should be pretty easy.

#5 theweave

theweave
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:15 PM

Posted 13 October 2009 - 09:28 AM

Umm. no, but judging by the sophistication of the code you provided, creating it on your own should be pretty easy.


Would you be interested in taking a look at it and helping me fix it for a small fee? I can get you a login to review all the code and help me fix this thing before my client has a cow about it!

#6 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:15 PM

Posted 13 October 2009 - 10:43 AM

I don't work for 'small' fees. :thumbsup:

glcb = Request.Form("Great Lakes Columbian Blend")
if glcb>0 Then
msg = "The amount of Great Lakes Columbian Blend is: "&glcb
else
msg = "There is no Great Lakes Blend ordered."
End If


#7 theweave

theweave
  • Topic Starter

  • Members
  • 7 posts
  • OFFLINE
  •  
  • Local time:05:15 PM

Posted 13 October 2009 - 11:04 AM

I don't work for 'small' fees. :thumbsup:

glcb = Request.Form("Great Lakes Columbian Blend")
if glcb>0 Then
msg = "The amount of Great Lakes Columbian Blend is: "&glcb
else
msg = "There is no Great Lakes Blend ordered."
End If


what would something like this run then?

#8 groovicus

groovicus

  • Security Colleague
  • 9,963 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Centerville, SD
  • Local time:04:15 PM

Posted 13 October 2009 - 11:25 AM

Something like that would retrieve the form data associated with a field called "Great Lakes Columbian Blend". If the value were greater than zero, it would concatenate that value onto a string, or it would just create a message that the value doesn't exist. Of course, it doesn't check for null values, or if the data is even a number.

You need to get each value from the form. If the value is valid and greater than zero, then add it to the order form. You do the same thing for each value.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users