Click to See Complete Forum and Search --> : forms


hcraig
05-05-2003, 04:19 PM
I'm working on an html form. Is it possible to have the form sent to a different email address based on the user's last name. For example Joe Lunchbucket types his name in the form, because his last name begins with an L and I want any last name from L to Z to go to jcly@webmedx.com, it would go there. Last names from A to K go to kkp@webmedx.com. Also is it possible to include an autoresponder, so that Joe Lunchbucket gets an automatic response.

thanks,
Henry

Bullschmidt
05-05-2003, 05:23 PM
Henry,

Sure, have the Web page post to another page or self-post to the same page. Perhaps validate that the LastName field is not blank and then on the new page:

' Get first letter in uppercase.
strFirstLetter = UCase(Left(Request.Form("LastName"), 1)

' Convert to ASCII number.
intFirstLetter = Asc(strFirstLetter)

' If K or less.
If intFirstLetter <= 75 Then
strEmailAddr = athruk@myemail.com
Else
strEmailAddr = lthruz@myemail.com
End If