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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: changing the value to display different text 2

Status
Not open for further replies.

danielh68

Technical User
Joined
Jul 31, 2001
Messages
431
Location
US
Hi

I'm working on an asp email form and it processes just fine. However, now I would like to change the values that I have for my fields to display something nices in the email.

For instance:

bodytxt = bodytxt & "Are you new to us?: " & new_yes & new_no & vbcrlf

I would like to have new_yes display in the received email as simply "Yes"...the same goes for new_no.

I experimented with no luck. Any help would be much appreciated.

Thanks,
Dan
 
what if before processing the email you set two variables

1. new_yes = "yes"
2. new_no = "no"

then use the new values
 
Hi Decojute,

Well, above the:
Set Mail = Server.CreateObject("Persits.MailSender")

I have this:
new_yes= Request.Form("new_yes")
new_no= Request.Form("new_no")
tl= Request.Form("tl")
ltl= Request.Form("ltl")

At first,I thought I could change it to something like:
------------------------------
new_yes= Request.Form("Yes")
------------------------------

With that changed, this statement:
----------------------------------
bodytxt = bodytxt & "Are you new to us?: " & new_yes & new_no & vbcrlf"
-----------------------------------
would grab "Yes" from above.

Is this right?

Thanks,
Dan
 
Hi Decojute,

I just tried exactly what you stated and it works perfectly.

Thanks a million,
Dan
 
Hi,

I'm back. I guess it wasn't as perfect as I thought. I only did one sample yesterday and had to stop. Anyhow, for some reason, I can't get the data to separate. Here's sample of my code:
---------------------------------------------
else
new_yes= Request.Form("new_yes")
new_no= Request.Form("new_no")

new_yes= "Yes"
new_no= "No"

Set Mail = Server.CreateObject("Persits.MailSender")
bodytxt = bodytxt & "Are you new to us?: " & new_yes & new_no & vbcrlf
-------------------------------------------------

The result I get from my email displays the following:

Are you new to us?: YesNo

How can I get it to read as two separate entities?

Thanks,
Dan
 
This should look something like this
Code:
this is the page who displays the selections

index.html
<form action=&quot;sendmail.asp&quot; method=post>
...
<select name=&quot;newuser&quot;>
 <option value=&quot;Yes&quot;>Yes 
 <option value=&quot;No&quot;>No
</select>
</form>

In the asp code now just use ths code

Set Mail = Server.CreateObject(&quot;Persits.MailSender&quot;)
bodytxt = bodytxt & &quot;Are you new to us?: &quot; & Request(&quot;newuser&quot;) & vbcrlf

How this works...
If the user selects Yes then Request(&quot;newuser&quot;) should have the &quot;Yes&quot; value there for you will receive the email with Yes as value.
If the user select No then Request(&quot;newuser&quot;) will have &quot;No&quot; value, and so the email.


________
George, M
 
Yes! Got it! Thanks a lot Shaddow for your help. Much appreciated. -- Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top