Hi,

I have this website which uses javascript to compute some mathematics... However, the script appear not to be working on firefox whereas the I.E and safari are working well, can someone help me with this, does Firefox have problems executing javascript? Thanks...

the below code is where the problem occurs

<script language="javascript">
function order(form1) {

    var Sub;
    var GST;
    var Total;

    Sub = parseFloat(form1.txtEPM430.value) + parseFloat(form1.txtEPM400.value) + parseFloat(form1.txtBPM100.value) + parseFloat(form1.               txtBPM400.value) + parseFloat(form1.txtIRBody.value) + parseFloat(form1.txtIRFore.value) + parseFloat(form1.txtIREar.value) +          parseFloat(form1.txtNRSham2.value) + parseFloat(form1.txtNRSham8.value) + parseFloat(form1.txtNRWash2.value) + parseFloat(          form1.txtNRWash8.value) + parseFloat(form1.txtNRBath2.value) + parseFloat(form1.txtNRBath8.value) + parseFloat(form1.          txtOutdoor.value) + parseFloat(form1.txtIndoor.value) + parseFloat(form1.txtPatch.value);

            form1.txtSub.value = Sub.toFixed(2);

    GST = Sub * 0.07;
    form1.txtGST.value = GST.toFixed(2);

    Total = Sub + GST;
    form1.txtTotal.value = Total.toFixed(2);

}

</script>

Edited 3 Years Ago by mike_2000_17: Fixed formatting

So, is the "doesn't work" some kind of rounding error in the result, caused by all those floating point operations?

Or is the "doesn't work" something more serious, like not running at all?

Hi, the script above actually does some calculation and display it in the textbox... below are the complete code, u may visit www.kanpei.com.sg/orderNow.html and check it out if possible, coz i am really lost....

<script type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>
<body>
<script language="javascript">
function order(form1) {

	var Sub;
	var GST;
	var Total;
	
	Sub = parseFloat(form1.txtEPM430.value) + parseFloat(form1.txtEPM400.value) + parseFloat(form1.txtBPM100.value) + parseFloat(form1.		          txtBPM400.value) + parseFloat(form1.txtIRBody.value) + parseFloat(form1.txtIRFore.value) + parseFloat(form1.txtIREar.value) +          parseFloat(form1.txtNRSham2.value) + parseFloat(form1.txtNRSham8.value) + parseFloat(form1.txtNRWash2.value) + parseFloat(          form1.txtNRWash8.value) + parseFloat(form1.txtNRBath2.value) + parseFloat(form1.txtNRBath8.value) + parseFloat(form1.          txtOutdoor.value) + parseFloat(form1.txtIndoor.value) + parseFloat(form1.txtPatch.value);
	
			form1.txtSub.value = Sub.toFixed(2);
	
	GST = Sub * 0.07;
	form1.txtGST.value = GST.toFixed(2);
	
	Total = Sub + GST;
	form1.txtTotal.value = Total.toFixed(2);
	
}

</script>

<script language="javascript">
function validate(form1) {
	if (form1.txtName.value == "") {
	alert("Please Enter your name.");
	return false;
	}
	else if (form1.txtAddress.value == "") {
	alert("Please Enter your Address.");
	return false;
	}
	else if (form1.txtContact.value == "") {
	alert("Please Enter your Contact No.");
	return false;
	}
	else 
	return true;
}



</script>

<table width="768" border="0" align="center">
  <tr>
    <td width="762" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="762" height="126">
      <param name="movie" value="New.swf" />
      <param name="quality" value="high" />
      <embed src="New.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="762" height="126"></embed>
    </object>
      <img src="Images/MenuBar.gif" width="762" height="34" border="0" usemap="#Map" /></td>
  </tr>

  <tr>
    <td height="17" bgcolor="#F4C402"><span class="style4">&nbsp;<a href="index.htm">Home</a> &gt; Order Now </span></td>
  </tr>
  <tr>
    <td align="left" valign="top" bgcolor="#0373B6"><table width="762" border="0">
      <tr>
        <td width="756" height="344" valign="top" bgcolor="#FFFFFF"><table width="756" border="0" align="left">

              <tr>
                <td width="750" bgcolor="#0373B6"><span class="style5">Order Form </span></td>
              </tr>
              <tr>
                <td><form id="form1" name="form1" method="post" action="orderNow.asp">
                  <span class="style48">If you are interested in purchasing our products, you can simply fill in the form <br />
                  below and send it to us for processing. </span><br />

                  <br />
                  <span class="style48">Please fill in all the information for your particulars for contacting purposes. </span><br />
                  <br />
                  <table width="750" border="0">
                    <tr>
                      <td colspan="2" bgcolor="#FFFFFF" class="style64">Personal Particulars </td>
                      <td bgcolor="#FFFFFF" class="style5">&nbsp;</td>
                      <td bgcolor="#FFFFFF" class="style5">&nbsp;</td>

                      <td bgcolor="#FFFFFF" class="style5">&nbsp;</td>
                    </tr>
                    <tr>
                      <td width="80" valign="top" bgcolor="#FFFFFF"><span class="style66"><span class="style70">*</span>Name:</span></td>
                      <td width="284" bgcolor="#FFFFFF"><input name="txtName" type="text" class="style4" id="txtName" /></td>
                      <td width="115"><span class="style48">
                        <label></label>
                      </span></td>

                      <td width="144"><span class="style48"></span></td>
                      <td width="105"><span class="style48"></span></td>
                      </tr>
                    <tr>
                      <td valign="top" bgcolor="#FFFFFF"><span class="style66"><span class="style70">*</span>Address:</span></td>
                      <td bgcolor="#FFFFFF"><textarea name="txtAddress" cols="35" rows="3" class="style67" id="txtAddress"></textarea></td>
                      <td><span class="style48">

                        <label></label>
                      </span></td>
                      <td><span class="style48"></span></td>
                      <td><span class="style48"></span></td>
                      </tr>
                    <tr>
                      <td valign="top" bgcolor="#FFFFFF"><span class="style66"><span class="style70">*</span>Contact:</span></td>
                      <td bgcolor="#FFFFFF"><input name="txtContact" type="text" class="style4" id="txtContact" /></td>

                      <td><span class="style48">
                        <label></label>
                      </span></td>
                      <td><span class="style48"></span></td>
                      <td><span class="style48"></span></td>
                      </tr>
                    <tr>
                      <td valign="top" bgcolor="#FFFFFF"><span class="style66">Email:</span></td>

                      <td bgcolor="#FFFFFF"><input name="txtEmail" type="text" class="style4" id="txtEmail" /></td>
                      <td><span class="style48">
                        <label></label>
                      </span></td>
                      <td><span class="style48"></span></td>
                      <td><span class="style48"></span></td>
                      </tr>
                    <tr>
                      <td colspan="2"><span class="style69">*Required Fields </span></td>

                      <td><span class="style48"></span></td>
                      <td><span class="style48"></span></td>
                      <td><span class="style48"></span></td>
                      </tr>
                    <tr>
                      <td colspan="2" bgcolor="#0373B6"><div align="center"><span class="style52">Item</span></div></td>
                      <td bgcolor="#0373B6"><div align="center"><span class="style52">Retail Prices </span></div></td>
                      <td bgcolor="#0373B6"><div align="center"><span class="style52">Quantity</span></div></td>

                      <td bgcolor="#0373B6"><div align="center"><span class="style52">Amount</span></div></td>
                      </tr>
                    <tr bgcolor="#0373B6">
                      <td colspan="5"><span class="style52">Therapeutic</span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Electronic Pulse Massager MB 430 </span></td>

                      <td><span class="style58">S$176.40</span></td>
                      <td><span class="style58">
                        <label>
                        <select name="listEPM430" id="listEPM430" onchange="num=176.40; form1.txtEPM430.value=(parseFloat(num) * form1.listEPM430.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>

                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>

                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
                        </label>
                      </span></td>
                      <td><span class="style58">
                        <label>S$
                        <input name="txtEPM430" type="text" id="txtEPM430" value="0.00" size="7" maxlength="10" readonly="True" style="text-align:right"/>

</label>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Electronic Pulse Massager (With Heat) MB 400 </span></td>
                      <td><span class="style58">S$354.90</span></td>
                      <td><span class="style58">
                        <select name="listEPM400" id="listEPM400" onchange="num=354.90; form1.txtEPM400.value=(parseFloat(num) * form1.listEPM400.value).toFixed(2);MM_callJS('order(form1)')">

                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>

                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>

                      </span></td>
                      <td><span class="style58">
                        S$
                            <input name="txtEPM400" type="text" id="txtEPM400" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#0373B6">
                      <td colspan="5"><span class="style52">Diagnostic</span></td>
                      </tr>

                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Blood Pressure Monitor (Wrist) BP 100 </span></td>
                      <td><span class="style58">S$92.40</span></td>
                      <td><span class="style58">
                        <select name="listBPM100" id="listBPM100" onchange="num=92.40; form1.txtBPM100.value=(parseFloat(num) * form1.listBPM100.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>

                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>

                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtBPM100" type="text" id="txtBPM100" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>

                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Blood Pressure Monitor (Arm) BP 400 </span></td>
                      <td><span class="style58">S$94.50</span></td>
                      <td><span class="style58">
                        <select name="listBPM400" id="listBPM400" onchange="num=94.50; form1.txtBPM400.value=(parseFloat(num) * form1.listBPM400.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>

                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>

                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtBPM400" type="text" id="txtBPM400" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>

                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">IR Body Fat Analyzer NFA 100 </span></td>
                      <td><span class="style58">S$89.25</span></td>
                      <td><span class="style58">
                        <select name="listIRBody" id="listIRBody" onchange="num=89.25; form1.txtIRBody.value=(parseFloat(num) * form1.listIRBody.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>

                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>

                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtIRBody" type="text" id="txtIRBody" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>

                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">IR Forehead Thermometer NFS 100 </span></td>
                      <td><span class="style58">S$81.90</span></td>
                      <td><span class="style58">
                        <select name="listIRFore" id="listIRFore" onchange="num=81.90; form1.txtIRFore.value=(parseFloat(num) * form1.listIRFore.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>

                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>

                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtIRFore" type="text" id="txtIRFore" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>

                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">IR Ear Thermometer TB 100 </span></td>
                      <td><span class="style58">S$60.90</span></td>
                      <td><span class="style58">
                        <select name="listIREar" id="listIREar" onchange="num=60.90; form1.txtIREar.value=(parseFloat(num) * form1.listIREar.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>

                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>

                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">

                        S$
                            <input name="txtIREar" type="text" id="txtIREar" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#0373B6">
                      <td colspan="5"><span class="style52">Body Care </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">No Rinse Shampoo 2oz </span></td>

                      <td><span class="style58">S$5.05</span></td>
                      <td><span class="style48">
                        <select name="listNRSham2" id="listNRSham2" onchange="num=5.05; form1.txtNRSham2.value=(parseFloat(num) * form1.listNRSham2.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtNRSham2" type="text" id="txtNRSham2" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">No Rinse Shampoo 8oz </span></td>

                      <td><span class="style58">S$12.60</span></td>
                      <td><span class="style48">
                        <select name="listNRSham8" id="listNRSham8" onchange="num=12.60; form1.txtNRSham8.value=(parseFloat(num) * form1.listNRSham8.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtNRSham8" type="text" id="txtNRSham8" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">No Rinse Body Wash 2oz </span></td>

                      <td><span class="style58">S$5.05</span></td>
                      <td><span class="style48">
                        <select name="listNRWash2" id="listNRWash2" onchange="num=5.05; form1.txtNRWash2.value=(parseFloat(num) * form1.listNRWash2.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtNRWash2" type="text" id="txtNRWash2" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">No Rinse Body Wash 8oz </span></td>

                      <td><span class="style58">S$12.60</span></td>
                      <td><span class="style48">
                        <select name="listNRWash8" id="listNRWash8" onchange="num=12.60; form1.txtNRWash8.value=(parseFloat(num) * form1.listNRWash8.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                          </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtNRWash8" type="text" id="txtNRWash8" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">No Rinse Body Bath 2oz </span></td>

                      <td><span class="style58">S$5.05</span></td>
                      <td><span class="style48">
                        <select name="listNRBath2" id="listNRBath2" onchange="num=5.05; form1.txtNRBath2.value=(parseFloat(num) * form1.listNRBath2.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                          </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtNRBath2" type="text" id="txtNRBath2" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">No Rinse Body Bath 8oz </span></td>

                      <td><span class="style58">S$12.60</span></td>
                      <td><span class="style48">
                        <select name="listNRBath8" id="listNRBath8" onchange="num=12.60; form1.txtNRBath8.value=(parseFloat(num) * form1.listNRBath8.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                          </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtNRBath8" type="text" id="txtNRBath8" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Mosquitoe Outdoor Hand Band </span></td>

                      <td><span class="style58">S$4.70</span></td>
                      <td><span class="style48">
                        <select name="listOutdoor" id="listOutdoor" onchange="num=4.70; form1.txtOutdoor.value=(parseFloat(num) * form1.listOutdoor.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                        </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtOutdoor" type="text" id="txtOutdoor" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Mosquitoe Indoor Hand Band </span></td>

                      <td><span class="style58">S$3.70</span></td>
                      <td><span class="style48">
                        <select name="listIndoor" id="listIndoor" onchange="num=3.70; form1.txtIndoor.value=(parseFloat(num) * form1.listIndoor.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                          </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtIndoor" type="text" id="txtIndoor" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2"><span class="style58">Mosquitoe Patch </span></td>

                      <td><span class="style58">S$5.35</span></td>
                      <td><span class="style48">
                        <select name="listPatch" id="listPatch" onchange="num=5.35; form1.txtPatch.value=(parseFloat(num) * form1.listPatch.value).toFixed(2);MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>

                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>

                          <option value="10">10</option>
                          </select>
                      </span></td>
                      <td><span class="style58">S$
                          <input name="txtPatch" type="text" id="txtPatch" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td colspan="2" rowspan="3" align="left" valign="top" bgcolor="#FFFFFF"><p class="style48"><br />

                          <strong>For other quantities, please contact   us at:</strong><br />
                          <strong>Tel: (65)6256   8187 <br />  
                        <span class="style48">Email:   <a href="mailto:sales@kanpei.com.sg" class="style71">sales@kanpei.com.sg</a></span></strong></p>                        </td>
                      <td bgcolor="#FFFFFF">&nbsp;</td>
                      <td valign="top" bgcolor="#BFE2FF"><div align="right"><span class="style63">Sub-Total:</span></div></td>
                      <td valign="top" bgcolor="#BFE2FF"><span class="style58">S$
                          <input name="txtSub" type="text" id="txtSub" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>

                      </span></td>
                      </tr>
                    <tr bgcolor="#BFE2FF">
                      <td bgcolor="#FFFFFF">&nbsp;</td>
                      <td valign="top" bgcolor="#BFE2FF"><div align="right"><span class="style63">GST:</span></div></td>
                      <td valign="top" bgcolor="#BFE2FF"><span class="style58">S$
                          <input name="txtGST" type="text" id="txtGST" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>

                    <tr bgcolor="#BFE2FF">
                      <td bgcolor="#FFFFFF">&nbsp;</td>
                      <td valign="top" bgcolor="#BFE2FF"><div align="right"><span class="style4"><span class="style62">Total Amount: </span><br />
                        For order below S$50 (excluding GST), S$8 delivery charge applies.</span></div></td>
                      <td valign="top" bgcolor="#BFE2FF"><span class="style58">S$
                          <input name="txtTotal" type="text" id="txtTotal" value="0.00" size="7" maxlength="10" ReadOnly="True" style="text-align:right"/>
                      </span></td>
                      </tr>

                    <tr bgcolor="#BFE2FF">
                      <td height="45" colspan="2" bgcolor="#FFFFFF">&nbsp;</td>
                      <td bgcolor="#FFFFFF">&nbsp;</td>
                      <td align="right" valign="top" bgcolor="#FFFFFF"><label>
                        <input type="submit" name="Submit" value="Send Order" onClick ="return validate(form1)"/>
                        </label></td>
                      <td align="left" valign="top" bgcolor="#FFFFFF"><label>
                        <input type="reset" name="Submit2" value="Clear Form" />
                      </label></td>

                      </tr>
                  </table>
                                </form>                  </td>
              </tr>
                </table></td>
        </tr>
    </table>
    </td>

  </tr>
  
  <tr>
    <td valign="top" bgcolor="#0373B6"><div align="center"><span class="style4"><a href="index.htm">Home</a> | <a href="AboutUs.htm">About Us</a> | <a href="Products.html">Products</a> | <a href="outlets.htm">Outlets </a>| <a href="ContactUs.html">Contact Us</a> | <a href="OrderNow.htm">Order Now</a> </span>| <span class="style4"><a href="Warrantyform.htm">Warranty </a></span></div></td>

  </tr>
  <tr>
    <td valign="top"><div align="center" class="style3">Copyright &copy; 2006 Kanpei Pte Ltd. All Rights Reserved. </div></td>
  </tr>
</table>

Sifting through that massive piece of code would be time consuming. If developing on Firefox, look into the Firebug addon which adds capabilities like Javascript debugging, error detection etc. Look at the errors which pop up in the Error Console; it will point you to the exact source of the problem.

Also, use code tags when posting code so that its easier to read; refer the forum announcements for more details.

Sorry for the flooding of codes up there... i have try using the error console to find out the problem location... the problem lies here.. and it says form 1 is not defined... Any clue? Thanks

<script type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>

It is only in IE[and some other buggy browsers] that the NAME or ID attribute of an element represents the element in consideration; which actually isn't correct. You actually need to grab the element in consideration by either traversing the DOM [getElementById] or using the form reference each form element holds.
- Replace the `form1' with `this.form'
- Move the entire code snippet in the onchange handler and then invoke that function with `this.form' passed in to that function

Also, you shouldn't use eval; there is always a better way of doing things. Read:
http://www.jibbering.com/faq/#eval
http://www.jibbering.com/faq/faq_notes/form_access.html

As mentioned earlier, read the forum for the use of code tags as many people might ignore posts with code without code tags.

Hi, thanks for all those resources!!! I am really cause i am really poor in javascript which is why my way of doing things isn't the best way... Which is why i hope i could get some clue from you guys... Would u kindly provide me a code snippet as to how it should be done, i am really lost... Thanks

I already provided the fix in my previous post. If what you posted really is your code then you shouldn't have problem understanding the fix I suggested. Anyways like I mentioned, you need to replace `form1' with `this.form' in your event handlers: onclick & onchange.

> Would u kindly provide me a code snippet as to how it should be
> done, i am really lost

Sifting through the entire code to fix the issue would be way too time consuming; you need to start learning Javascript using the links I provided.

Hi, i have replace those form1 with this.form, please have a look thanks... but the problem still say form1 is undefined. any idea?

<script type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>
<select name="listEPM430" id="listEPM430" onchange="num=176.40; this.form.txtEPM430.value=(parseFloat(num) * this.form.listEPM430.value).toFixed(2); MM_callJS('order(form1)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>

and i also change the form1 in my function to this.form, but it doesn't work.. Sorry about that...

<script language="javascript">
function order(form1) {

	var Sub;
	var GST;
	var Total;
	
	Sub = parseFloat(this.form.txtEPM430.value) + parseFloat(this.form.txtEPM400.value) + parseFloat(this.form.txtBPM100.value) + parseFloat(this.form.		          txtBPM400.value) + parseFloat(this.form.txtIRBody.value) + parseFloat(this.form.txtIRFore.value) + parseFloat(this.form.txtIREar.value) +          parseFloat(this.form.txtNRSham2.value) + parseFloat(this.form.txtNRSham8.value) + parseFloat(this.form.txtNRWash2.value) + parseFloat(          this.form.txtNRWash8.value) + parseFloat(this.form.txtNRBath2.value) + parseFloat(this.form.txtNRBath8.value) + parseFloat(this.form.          txtOutdoor.value) + parseFloat(this.form.txtIndoor.value) + parseFloat(this.form.txtPatch.value);
	
			this.form.txtSub.value = Sub.toFixed(2);
	
	GST = Sub * 0.07;
	this.form.txtGST.value = GST.toFixed(2);
	
	Total = Sub + GST;
	this.form.txtTotal.value = Total.toFixed(2);
	
}

</script>

> MM_callJS('order(form1)')

Replace the above with order(this.form); .

> and i also change the form1 in my function to this.form

Like I mentioned, change form1 to this.form only in onchange and onclick handlers and not anywhere else. The form1 in your function is the form reference which is passed as an argument to the order() function.

Hi, as u suggested, i have done the changes... but this time round, it is the formula issue... it says form1 is undefined, and i think the onchange part u corrected me is not having problem now... Thanks

Sub = parseFloat(form1.txtEPM430.value) + parseFloat(form1.txtEPM400.value) + parseFloat(form1.txtBPM100.value) + parseFloat(form1.		    txtBPM400.value) + parseFloat(form1.txtIRBody.value) + parseFloat(form1.txtIRFore.value) + parseFloat(form1.txtIREar.value) + parseFloat(form1.txtNRSham2.value) + parseFloat(form1.txtNRSham8.value) + parseFloat(form1.txtNRWash2.value) + parseFloat(form1.txtNRWash8.value) + parseFloat(form1.txtNRBath2.value) + parseFloat(form1.txtNRBath8.value) + parseFloat(form1.txtOutdoor.value) + parseFloat(form1.txtIndoor.value) + parseFloat(form1.txtPatch.value);

Have you made the fix suggested in my previous post? Re-post the entire code and point out the line which is having problems.

Hi, i have made those changes, below are those section which have been changed... and i uses firebug and saw this message...

<script type="text/JavaScript">
<!--
function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
//-->
</script>
<script language="javascript">
function order(form1) {

	var Sub;
	var GST;
	var Total;
	
	Sub = parseFloat(form1.txtEPM430.value) + parseFloat(form1.txtEPM400.value) + parseFloat(form1.txtBPM100.value) + parseFloat(form1.		    txtBPM400.value) + parseFloat(form1.txtIRBody.value) + parseFloat(form1.txtIRFore.value) + parseFloat(form1.txtIREar.value) + parseFloat(form1.txtNRSham2.value) + parseFloat(form1.txtNRSham8.value) + parseFloat(form1.txtNRWash2.value) + parseFloat(form1.txtNRWash8.value) + parseFloat(form1.txtNRBath2.value) + parseFloat(form1.txtNRBath8.value) + parseFloat(form1.txtOutdoor.value) + parseFloat(form1.txtIndoor.value) + parseFloat(form1.txtPatch.value);
	
	form1.txtSub.value = Sub.toFixed(2);
	
	GST = Sub * 0.07;
	form1.txtGST.value = GST.toFixed(2);
	
	Total = Sub + GST;
	form1.txtTotal.value = Total.toFixed(2);
	
}

</script>
<select name="listEPM430" id="listEPM430" onchange="num=176.40; this.form.txtEPM430.value=(parseFloat(num) * this.form.listEPM430.value).toFixed(2); MM_callJS('order(this.form)')">
                          <option>Select Quantity</option>
                          <option value="1">1</option>
                          <option value="2">2</option>
                          <option value="3">3</option>
                          <option value="4">4</option>
                          <option value="5">5</option>
                          <option value="6">6</option>
                          <option value="7">7</option>
                          <option value="8">8</option>
                          <option value="9">9</option>
                          <option value="10">10</option>
                        </select>
form1 is undefined
order(undefined)
eval()()(line 1)
MM_callJS("order(this.form)")
onchange(change )

> Hi, i have made those changes

It seems you haven't since I still see the call "MM_callJS('order(this.form)')"; re-read reply 10.

Hi ~s.o.s~ ,

Thanks for all the hints and help.. i manage to make it work on firefox now.... =) Appreciate your help...

I don't have any experience of that problem but i wanted to help you that's why i ll search the solution of this problem.wait for few time...

This question has already been answered. Start a new discussion instead.