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-data"
  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("response()",2000)'>
</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.htm"><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></center>



<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>
senthil021397Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kollegovCommented:
Solution is easy:
You can set some semaphore variable to true
in function submitting e-mail
let it be declared as

var semaphore=null

so in function mailit()
add single row before return:

semaphore=true;

function response than can be modified:


      function response()

      { if(semaphore)
         {if(semaphore==true)
           {setTimeout('location.href="http://msp03.msp.sc.ti.com/',500}
         }
        else
         setTimeout("response()",100)
      }

Thus this function will be called recursevly each 100ms
And check was the form submited or not, if it is already submited it will set 500ms timeout for submission and change location.

You now do not need 2sec timout onClick, make it 100ms. :)

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
senthil021397Author Commented:
Kollegov,

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


0
senthil021397Author Commented:
Still waiting for Solution
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.