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

A eMail form with "Response" page.

Status
Not open for further replies.

WJordanjr

IS-IT--Management
Nov 6, 2002
4
US
I found this example on creating an email form with a response page: and I was wondering if anyone has an example or knows where I might be able to find one for doing this in layers. My problem is that my new web site is being created using mostly layers and I am trying to convert the forms on the old site to work with layers. This is our test web site ( if that would help. Anyway, with all the research I have done, it seems I need to have two layers in my forms page with the form visible and the response hidden. Once the user clicks on "submit”, the form is validated with JavaScript and then processed via an asp page. The problem seems to be in the asp page with this command "Response.Redirect "helpnow.htm"". It seems to me, there has to be a way to point the response back to the form page and flip the "show/hide" to show the response layer and hide the form layer.

I hope I am not bothering you with this and giving you too much information, but I have tried a lot of research and have not come up with anything directly addressing this issue. Therefore, I thought, based on the posts in this forum this might be the place with the knowledge that could help me. Any help would be appreciated, and if you cannot I am sorry for the interruption.

Sincerely,
Wayne Jordan "The Computer Guru"
Technical Director
Megabytes Computers & Networking, Inc.
Solve Your Computer Problem in Five Minutes at: Email - mailto:wayne@megabytescomputers.com
Toll Free - (888) 589-2655
Voice - (904) 880-6366
Fax - (904) 880-1560
Cell - (904) 333-2142
"Teamwork is the fuel
 
Hi,
I didn't see the Response.Redirect &quot;helpnow.htm line that you were talking about. What I'd do is to set the target of the form to a new window (<form target=&quot;_blank&quot;>), then in that page, onLoad, tell it to load the thank you layer then close itself (something like this?):
<body onLoad=&quot;window.opener.loadPage('contentLayer',null,'thanks.htm');self.close();&quot;>
You would then remove any lines in the asp file that have to do with redirecting or displaying messages.

Rick

P.S. There is no need to apologize for asking a question. Without questions, we couldn't give answers;-). I think I speak for all of us when I say that we would rather have too much info than too little.
 
Maybe this will help:

The following code was a sample I found and it is pretty close to what I need to do but since there is no processing going on (i.e. emailing the data) I'm stuck as to how to adapt this code for my situation.

*********************************
<script language=&quot;JavaScript&quot;><!--
var toggle = false;

function show(object) {
if (document.layers && document.layers[object])
document.layers[object].visibility = 'visible';
else if (document.all) {
document.all[object].style.visibility = 'visible';
document.all[object].style.zIndex = 100;
}
}
function hide(object) {
if (document.layers && document.layers[object])
document.layers[object].visibility = 'hidden';
else if (document.all)
document.all[object].style.visibility = 'hidden';
}
//--></script>
<form>
<input type=&quot;button&quot; onClick=&quot;if (toggle = !toggle) hide('myId');else show('myId')&quot; value=&quot;Show/Hide&quot;>
</form>
<div id=&quot;myId&quot; style=&quot;position: absolute; visibility: visible;&quot;>Test</div>
***********************************************

This is my helpnow.htm that contains the form layer and response layer.
***********************************************
<html>
<!-- InstanceBegin template=&quot;/Templates/child page.dwt&quot; codeOutsideHTMLIsLocked=&quot;false&quot; -->
<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>
<body id=&quot;theBody&quot; onload=&quot;parent.showPage('contentLayer')&quot;>
<!-- InstanceBeginEditable name=&quot;new content goes here&quot; -->
<!--remove this line after finish edit-->
<div id=&quot;title&quot;>request support form</div>
<div id=&quot;main&quot; class=&quot;blur bdr&quot;></div>
<div id=&quot;maintext&quot;>
<p>Simply fill out the form below with your name, e-mail address, telephone
number and a brief description of your problem and click &quot;Request Support&quot;.
Then leave the rest up to us! Within minutes we will call you at the number
you've provided and send you an invitation via e-mail to an online session.
Over the telephone, a trained technician will listen to your problem and guide
you - start to finish - through the solution. </p>
<table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;0&quot;>
<caption> 
</caption>
</table>
<form name=&quot;form1&quot; onsubmit=&quot;return doSubmit()&quot; method=&quot;post&quot; action=&quot;request.asp&quot;>
<table border=&quot;0&quot; align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;1&quot;>
<tr>
<td><input name=&quot;clientFName&quot; type=&quot;text&quot; id=&quot;clientFName&quot; onFocus=&quot;this.select(value='')&quot; value=&quot;First Name&quot; size=&quot;20&quot;></td>
<td><input name=&quot;clientLName&quot; type=&quot;text&quot; id=&quot;clientLName&quot; onFocus=&quot;this.select(value='')&quot; value=&quot;Last Name&quot; size=&quot;20&quot;></td>
</tr>
<tr>
<td><input name=&quot;email&quot; type=&quot;text&quot; id=&quot;email&quot; onFocus=&quot;this.select(value='')&quot; value=&quot;eMail Address&quot; size=&quot;20&quot;></td>
<td><input name=&quot;phone&quot; type=&quot;text&quot; id=&quot;phone&quot; onFocus=&quot;this.select(value='')&quot; value=&quot;Phone Number&quot; size=&quot;20&quot;></td>
</tr>
<tr>
<td colspan=&quot;2&quot;><textarea name=&quot;problem&quot; cols=&quot;36&quot; rows=&quot;3&quot; id=&quot;problem&quot; onFocus=&quot;this.select(value='')&quot;>Your Question</textarea>
</td>
</tr>
<tr>
<td colspan=&quot;2&quot;><input name=&quot;Submit&quot; type=&quot;submit&quot; onClick=&quot;MM_validateForm('clientFName','','R','clientLName','','R','email','','RisEmail','phone','','RisNum','problem','','R');MM_showHideLayers('pendrequest','','show');MM_showHideLayers('maintext','','hide');return document.MM_returnValue&quot; value=&quot;Request Support!&quot;>
<input type=&quot;reset&quot; name=&quot;Submit2&quot; value=&quot;RESET&quot;> </tr>
</table>
</form>
</div>
<div id=&quot;extent2&quot; class=&quot;extent&quot;>
<p class=&quot;bold&quot;> Dear , </p>
<p>This is an automatic reply from OnCall4U to let you know that we have received
your support request. As soon as our support professionals have had a chance
to process your request or investigate your inquiry, we will respond to you
using the following information. We will be using the following information
to contact you:</p>
<p class=&quot;bold&quot;>Your Name: <br />
E-mail: <br />
Your Phone: </p>
<p>If any of this information is incorrect, please go back to the form and alter
it. We thank you for taking the time to help us give you better service.</p>
<p>Yours Sincerely,</p>
<p>Wayne Jordan<br />
Technical Director</p>
</div>
<!-- InstanceEndEditable -->
</body>
<!-- InstanceEnd -->
</html>


*************************************************

This is my current asp page that processes the form. I need to somehow do what the example code above does but also do this below:
************************************
<%
strFName = Request.Form(&quot;clientFName&quot;)
strLName = Request.Form(&quot;clientLName&quot;)
strEmail = Request.Form(&quot;email&quot;)
strPhone = Request.Form(&quot;phone&quot;)
strProblem = Request.Form(&quot;problem&quot;)

Dim objCDOMail, strBody, strTechBody
strBody = strFName & &quot;, thank you for reqesting an OnCall4U support session.&quot; & vbCrLf & vbCrLf
strBody = strBody & &quot;You have given the following phone number: &quot; & strPhone & &quot;.&quot; & vbCrLf
strBody = strBody & &quot;You have specified the following problem: &quot; & vbCrLf & vbCrLf
strBody = strBody & strProblem & vbCrLf & vbCrLf
strBody = strBody & &quot;Please wait for our technician to call you.&quot; & vbCrLf & vbCrLf
strBody = strBody & &quot;Thank You, &quot; & vbCrLf & &quot;OnCall4U&quot; & vbCrLf & &quot;(888) 589-2655&quot; & vbCrLf

strTechBody = vbCrLf & &quot;Name: &quot; & strFName & &quot; &quot; & strLName & vbCrLf
strTechBody = strTechBody & &quot;eMail: &quot; & strEmail & vbCrLf & vbCrLf & &quot;Date: &quot; & Date & vbCrLf
strTechBody = strTechBody & &quot;Phone: &quot; & strPhone & vbCrLf
strTechBody = strTechBody & &quot;Problem: &quot; & strProblem & vbCrLf

Set objCDOMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objCDOMail.From = &quot;support@megabytescomputers.com&quot;
objCDOMail.To = strEmail
objCDOMail.Subject = &quot;OnCall4U Request Support&quot;
objCDOMail.Body = strBody
objCDOMail.Send
Set objCDOMail = Nothing

Set objCDOMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objCDOMail.From = &quot;support@megabytescomputers.com&quot;
objCDOMail.To = &quot;support@megabytescomputers.com&quot;
objCDOMail.Subject = &quot;OnCall4U Request Support&quot;
objCDOMail.Body = strTechBody
objCDOMail.Send
Set objCDOMail = Nothing

Set objCDOMail = Server.CreateObject(&quot;CDONTS.NewMail&quot;)
objCDOMail.From = &quot;support@megabytescomputers.com&quot;
objCDOMail.To = &quot;9043332142@voicestream.net&quot;
objCDOMail.Subject = &quot;OnCall4U Request Support&quot;
objCDOMail.Body = strTechBody
objCDOMail.Send
Set objCDOMail = Nothing

Response.Redirect &quot;helpnow.htm&quot;
*****This line above I know is wrong *********
%>

I hope this helps. Wayne Jordan &quot;The Computer Guru&quot;
Technical Director
Megabytes Computers & Networking, Inc.
Solve Your Computer Problem in Five Minutes at: Email - mailto:wayne@megabytescomputers.com
Toll Free - (888) 589-2655
Voice - (904) 880-6366
Fax - (904) 880-1560
Cell - (904) 333-2142
&quot;Teamwork is the fuel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top