senthil021397
asked on
Evaluate my program
Please evaluate my Javascript program which collects all the form inputs and mails to a email account. My users have various versions of Netscape and some of them have the warning message box which comes off before submitting a form. My problem is, if the user waits for a few more seconds than the timeout period to hit OK in the warning box, then the program doesn't work.
Is there a solution to fix this problem. Also, I am able to disable the Form Submit Warning box in Netscape 3.0 and am not able to do that in Netscape Communicator 4.02
========================== ========== ========== =======
<HTML>
<HEAD><TITLE>MSP Systems Feedback Form</TITLE>
<SCRIPT>
function response()
{
location.href="http://msp03.msp.sc.ti.com/";
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function mailIt(form) {
var data = document.dataForm
var userInfo = ""
form.action += "?subject=" + data.subject.value
userInfo += "Page Title: " + document.title + "\n"
userInfo += "Mailed From: " + document.location + "\n\n"
form.mailBody.value = userInfo + data.body.value
location.href="http://msp03.msp.sc.ti.com/";
return true
}
// -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT=navy LINK=red VLINK=red>
<center>
<TABLE BORDER=3 CELLSPACING=5 width=600>
<tr>
<th><a href="/index.html"><FONT COLOR="black">MSP Business Systems</a></th>
<th><a href="/reports.html"><FONT COLOR="black">MSP Reports Home</a></th>
</tr>
</TABLE>
</center>
<CENTER>
<TABLE>
<FORM NAME="dataForm">
<TR>
<TH ALIGN=right>Name:
<TD><INPUT NAME="name" SIZE=40 >
</TR>
<!-- DELETE THIS TABLE ROW IF YOU'RE HARDCODING A SUBJECT -->
<TR>
<TH ALIGN=right>Subject:
<TD><INPUT NAME="subject" SIZE=40>
</TR>
<TR>
<TH ALIGN=right VALIGN=top>Message:
<TD><TEXTAREA NAME="body" COLS=60 ROWS=10 WRAP=virtual></TEXTAREA>
</TR>
</FORM>
<FORM
NAME="mailForm"
ACTION="mailto:senthil@ti. com"
METHOD="post"
ENCTYPE="multipart/form-da ta"
onSubmit="return mailIt(this)">
<INPUT TYPE="hidden" NAME="mailBody" VALUE="">
<TR>
<TD COLSPAN=2 ALIGN=center>
<INPUT TYPE="submit" VALUE="Send This Mail Message Now" onClick='setTimeout("respo nse()",200 0)'>
</TR>
</FORM>
</TABLE>
<p>
<p>
<center><nobr><A HREF="http://www.ti.com/sc/docs/schome.htm"><IMG SRC="/OWS-IMG/scnv1.gif" ALT="Semiconductors" border=0></a><A HREF="http://www.ti.com/sc/docs/msp/msphome.htm"><IMG SRC="/OWS-IMG/scnvmsp.gif" ALT="Mixed Signal and Analog" border=0></A><A HREF="http://www.ti.com/sc/docs/search.htm"><IMG SRC="/OWS-IMG/mpsernav.gif " border=0 ALT="Search"></A><A HREF="/sc/docs/feedback.ht m"><IMG SRC="/OWS-IMG/feednav.gif" border=0 ALT="Feedback"></A><A HREF="http://www.ti.com/corp/docs/home.htm"><IMG SRC="/OWS-IMG/tihmnav.gif" border=0 ALT="TI Home"></A></nobr><BR></cen ter>
<ADDRESS>
<CENTER>
<A HREF="http://www.ti.com/corp/docs/copyrght.htm">(c) Copyright</A> 1997 Texas Instruments Incorporated. All rights reserved. <BR>
<p>
<center><IMG SRC="/OWS-IMG/owsdr.gif">< /center>
</CENTER>
</ADDRESS>
<CENTER>
<script language="JavaScript">
<!--
document.write("Updated " + document.lastModified);
// -->
</script>
</CENTER>
</BODY>
</HTML>
Is there a solution to fix this problem. Also, I am able to disable the Form Submit Warning box in Netscape 3.0 and am not able to do that in Netscape Communicator 4.02
==========================
<HTML>
<HEAD><TITLE>MSP Systems Feedback Form</TITLE>
<SCRIPT>
function response()
{
location.href="http://msp03.msp.sc.ti.com/";
}
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function mailIt(form) {
var data = document.dataForm
var userInfo = ""
form.action += "?subject=" + data.subject.value
userInfo += "Page Title: " + document.title + "\n"
userInfo += "Mailed From: " + document.location + "\n\n"
form.mailBody.value = userInfo + data.body.value
location.href="http://msp03.msp.sc.ti.com/";
return true
}
// -->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT=navy LINK=red VLINK=red>
<center>
<TABLE BORDER=3 CELLSPACING=5 width=600>
<tr>
<th><a href="/index.html"><FONT COLOR="black">MSP Business Systems</a></th>
<th><a href="/reports.html"><FONT
</tr>
</TABLE>
</center>
<CENTER>
<TABLE>
<FORM NAME="dataForm">
<TR>
<TH ALIGN=right>Name:
<TD><INPUT NAME="name" SIZE=40 >
</TR>
<!-- DELETE THIS TABLE ROW IF YOU'RE HARDCODING A SUBJECT -->
<TR>
<TH ALIGN=right>Subject:
<TD><INPUT NAME="subject" SIZE=40>
</TR>
<TR>
<TH ALIGN=right VALIGN=top>Message:
<TD><TEXTAREA NAME="body" COLS=60 ROWS=10 WRAP=virtual></TEXTAREA>
</TR>
</FORM>
<FORM
NAME="mailForm"
ACTION="mailto:senthil@ti.
METHOD="post"
ENCTYPE="multipart/form-da
onSubmit="return mailIt(this)">
<INPUT TYPE="hidden" NAME="mailBody" VALUE="">
<TR>
<TD COLSPAN=2 ALIGN=center>
<INPUT TYPE="submit" VALUE="Send This Mail Message Now" onClick='setTimeout("respo
</TR>
</FORM>
</TABLE>
<p>
<p>
<center><nobr><A HREF="http://www.ti.com/sc/docs/schome.htm"><IMG SRC="/OWS-IMG/scnv1.gif" ALT="Semiconductors" border=0></a><A HREF="http://www.ti.com/sc/docs/msp/msphome.htm"><IMG SRC="/OWS-IMG/scnvmsp.gif"
<ADDRESS>
<CENTER>
<A HREF="http://www.ti.com/corp/docs/copyrght.htm">(c) Copyright</A> 1997 Texas Instruments Incorporated. All rights reserved. <BR>
<p>
<center><IMG SRC="/OWS-IMG/owsdr.gif"><
</CENTER>
</ADDRESS>
<CENTER>
<script language="JavaScript">
<!--
document.write("Updated " + document.lastModified);
// -->
</script>
</CENTER>
</BODY>
</HTML>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Still waiting for Solution
ASKER
One part of solution seems to work, Even with the Warning box enabled, the browser is still holding the data till i click OK. It doens'nt matter how long i wait. BUT, after clicking OK, location.href="http....." doesn't seem to work. It stays in the same page.
I tried a few things without success. Any thoughts..
Senthil