Form's onsubmit is called but action is not performed


I have a coldfusion page FileRequest.cfm. On this page, there is form in which onsubmit method is specified  - which is formatreg(). The Form has  ACTION="<CFOUTPUT>#APPLICATION.ServerURL#</CFOUTPUT>/file/fileRequest.cfm"
which is calling the same page i.e. filerequest.cfm

What happens is when I click on submit button, this onsubmit method(formatreg  ) is called but the action is never performed i.e.  "<CFOUTPUT>#APPLICATION.ServerURL#</CFOUTPUT>/file/fileRequest.cfm"
is never called, so the page just stays there and does nothing....

This happens on just one client's machine. I donot know what browser settings on his machine are causing this. Is it becos of browser settings or something else. Client is using IE 6  and Coldfusion version is 7 .

I read @ problems with onsubmit method on It says that since its javascript it does give some problems and it says to check cgi script. but since this does not happen on all the machines, i donot think its this issuse...

I have pasted the code below...

Pl help...


<CFIF #parameterexists(vadd)# is "Yes">
    <CFIF #filetype# is "F" AND #IsDate(enddate)# is "No">
                  <SCRIPT LANGUAGE="JavaScript">
            alert("Your end date (#enddate#) is not a valid date.\nPlease enter with a format of MM/DD/YYYY.")

    <CFIF #len(filetext)# LT 1>
                 <SCRIPT LANGUAGE="JavaScript">
            alert("You must provide text \nfor your file.")

  <CFLOCATION URL="fileThanks.cfm?A=#Variable.Action#">

function formatReg(form)
   if (form.Email.value.length ==0)
           alert("Please provide your e-mail address");
           return false;


<script language="javascript" >
  function selfileType_SetDisplay ()
     var trEndDate = document.all.item("trEndDate");
     var selfileType = document.all.item("filetype");

         if (selfileType.value == "F")
         return true;


<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" onload="selfileType_SetDisplay()">

<p align="center"><font face="Arial" color="#000080" size="2">Please make sure that you fill out
all of the fields in </font><font face="Arial" color="#FF0000" size="2">red</font><font
face="Arial" color="#000080">.</font></p>
<FORM METHOD="post" onSubmit="return formatReg(this)" ACTION="<CFOUTPUT>#APPLICATION.ServerURL#</CFOUTPUT>/file/fileRequest.cfm">
      <table align="Center" border="4" cellpadding="6" cellspacing="2" width="90%">

      <TR><TD COLSPAN="2" ALIGN="Center" BGCOLOR="#000091">
                <FONT FACE="Arial" COLOR="#FFFFFF" SIZE="-1">

                 <TD BGCOLOR="EEEEEE">First Name</TD>
                 <td> <INPUT TYPE="text" NAME="firstname" SIZE="25" MAXSIZE="" VALUE=""><br></TD>

         <TD BGCOLOR="EEEEEE">Last Name</TD>
         <td> <INPUT TYPE="text" NAME="lastname" SIZE="25" MAXSIZE="" VALUE=""><br></TD>

         <TD BGCOLOR="EEEEEE">Phone:</TD>
                 <td><INPUT TYPE="text" NAME="Phone" SIZE="25" MAXSIZE="" VALUE=""><br></TD>

        <TD BGCOLOR="EEEEEE"><font face="Arial" color="#FF0000" size="2">E-Mail</TD>
        <td> <INPUT TYPE="text" NAME="Email" SIZE="25" MAXSIZE="" VALUE=""> </TD>

                <TD BGCOLOR="EEEEEE"> <font face="Arial" color="#FF0000" size="2">file Type:</TD>
        <TD><SELECT ID="selfileType" size="1" name="filetype"  onchange="javascript:selfileType_SetDisplay ()">
             <option value="" selected >--Select Type--</option>
             <option value="G"  >General file</option>
             <option value="I"  >Incorrect File</option>
             <option value="M"  >Missing Info</option>
             <option value="F"  >Other Notes</option>

   <TR id="trEndDate" style="display:none">
        <td  BGCOLOR="EEEEEE"><font face="Arial" color="#FF0000" size="2">Other Notes End Date:</td>
        <td> <input type="text" size="10" maxlength="10" name="enddate" value=""> Format: MM/DD/YYYY</td>

             <td  BGCOLOR="EEEEEE"><font face="Arial" color="#FF0000" size="2">file Text:</td>
                 <TD>  <TEXTAREA NAME="filetext" ROWS=6 COLS=50 wrap=hard></TEXTAREA> </TD>

             <td COLSPAN="2" ALIGN="Center">
                      <input type="submit" value="Submit" NAME="vadd">
                      <input type="button" value=" Cancel " onclick="window.close()">


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

You will probably have more luck if you post this in the following zone:
Internet > Web Development > Web > Coldfusion Studio
at999Author Commented:
thanks tdlewis for the reply,
but i think this is issue with cgi/IIS (I donot know anything in CGI)

But I read @ problems with onsubmit method(onsubmit method is called when the form is submitted) on It says that since its javascript it does give some problems and it says to check cgi script.
thats why i placed in CGI section
The action of your form is .../fileRequest.cfm so the "CGI" that is being executed is a ColdFusion file.

As for your onsubmit method, it is called between the time the "Submit" button is clicked and the form is sent to the server. Its purpose is to determine whether the form should be sent to the server or not. If formatReg returns false then the browser will not send the form to the server; in the code you supplied, the only thing that would prevent the form from being submitted is for form.Email.value.length == 0.

Assuming that the email field is not blank, the data is sent to the server. In that case, you need to look at fileRequest.cfm and determine why it is not doing what you expect.

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
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
Scripting Languages

From novice to tech pro — start learning today.