[Javascript] JavaScript Syntax Error in IE 5.5

Mohamed Mahmoud mohamed at siliconexpert.com
Tue May 8 12:20:22 CDT 2001


I have this script that runs fine in IE 5.0, but gives me a syntax error in
IE 5.5 !!
I get the error on the following line of code:

      f.submit();

Here is the Script

<SCRIPT LANGUAGE="java-script1.2">

function ValidateCompare(form)
{
   var uppper_limit;
   var i=0;
   var CompareQty=0
   upper_limit = form.elements.length;
   while(i<upper_limit)
   {
        if (form.elements[i].name == "ITEMLIST")
        {
            if (form.elements[i].value != '0')
                CompareQty++;
        }
        i++;
   }
   if (CompareQty < 2)
   {
       alert("You must select two or more products to compare");
       return(false);
   }
   return(true);
}

function SubmitForm()
{
   f = this.document.VIEW_LIST;
   if(ValidateCompare(f))
   {
      f.submit();
   }

}

</java-script>;

and this is how I call the function

<A HREF="java-scriptthis.SubmitForm();"><IMG BORDER="0"
   ALT="[Compare]" SRC="media/images/compare_btn.gif"></A>


I have a FORM defined as follows:

<FORM METHOD="GET" ACTION="features.asp" NAME="VIEW_LIST"
onfiltered="return ValidateCompare(this)">

Please let me know if you have any suggestions

Thank you



____________________________________________________________________________
________

Mohamed M. Mahmoud
Sr. Software Engineer
SiliconExpert Technologies, Inc.
Tel: 408-330-7656
Fax: 408-330-7511
mailto:mohamed at siliconexpert.com
http://www.siliconexpert.com
____________________________________________________________________________
________





More information about the Javascript mailing list