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

contact form with radio button 1

Status
Not open for further replies.

missplume

Technical User
Joined
Sep 4, 2001
Messages
29
Location
US
I am beginning to move from cgi form to asp for my "contact me" page.
<!--begin sarcasm ha ha end sarcasm ha -->
I have managed to make a really simple contact me page that allows me to collect name, email and message. That works just fine.
I thought that I could venture in asking an additional &quot;or&quot; question (are you age 12 and under or are you age 13 and over). I set it tup in the contact.htm page and proceeded to copy whatever was in the .asp and apply it to my added &quot;age&quot; field. I am stumped.
The age radio buttton is called &quot;age&quot; in contact.htm.
here is the code i used on the asp form (SendMail2.asp)

<%@LANGUAGE = VBSCRIPT%> <HTML>


<SCRIPT language=&quot;JavaScript&quot;>
<!--
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args+&quot;.location='&quot;+args[i+1]+&quot;'&quot;);
}
//-->
</SCRIPT>

<BODY onLoad=&quot;MM_goToURL('parent','../thanx.htm');return document.MM_returnValue&quot;>
<%

' Get the form data
name = Request.Form(&quot;name&quot;)
senderEmail = Request.Form(&quot;email&quot;)
subject = Request.Form(&quot;subject&quot;)
recipient = &quot;contact@macomoodus.com&quot;
body = Request.Form(&quot;body&quot;)
age = Request.Form(&quot;age&quot;)

' Create the JMail message Object
set msg = Server.CreateOBject( &quot;JMail.Message&quot; )

' Set logging to true to ease any potential debugging
' And set silent to true as we wish to handle our errors ourself
msg.Logging = true
msg.silent = true

' Enter the sender data
msg.From = senderEmail
msg.FromName = name

' Note that as addRecipient is method and not
' a property, we do not use an equals ( = ) sign
msg.AddRecipient recipient

' The subject of the message
msg.Subject = subject

' And the body
msg.body = body

' And the age
msg.body = age

' Now send the message, using the indicated mailserver
if not msg.Send(&quot;mail.macomoodus.com&quot; ) then
Response.write &quot;<pre>&quot; & msg.log & &quot;</pre>&quot;
else
Response.write &quot;Thank you for contacting Mac O' Moodus!&quot;
end if


' And we're done! the message has been sent.


%>
</BODY>
</HTML>

Thanks for your attention!
 
the age is not being picked? or what is the problem?

Known is handfull, Unknown is worldfull
 
Duh, Sorry about that ommission!
when i add the age, everything seems ok from the visitor's point of view but I don't receive the message.
 
only the age part sent right?

thats becuase of this:
Code:
' And the body
msg.body = body

'  And the age
msg.body = age

first time the body is ur orginal message but in the next line u r assigining it to the age variable (it will remove the body variable's content). try this:
Code:
body=body&age
msg.body = body

hth

Known is handfull, Unknown is worldfull
 
vbkris, belated thank you! problem solved!
[thumbsup2]
 
glad to be of help...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top