Try with the following code:

<script>

function proc()
 {
 var num = document.heartSearch.hsQty.value*8.95;
 document.hSearchoutput.hsTotal.value = r2(num);
 addMe();
 }

function prc2()
 {
 var num = document.youKnow.cutSandHours.value*12.17;
 document.outme.soter.value = r2(num);
 addMe();
 }

function addMe(){
 var x = document.hSearchoutput.hsTotal.value;
 var y = document.outme.soter.value;
 var num = parseFloat(x)+parseFloat(y);
 document.costAndTtl.TtlCost.value = r2(num);
}

function r2(n)
 {
 ans = n * 1000;
 ans = Math.round(ans /10) + "";
 while (ans.length < 3) {ans = "0" + ans;}
 len = ans.length;
 ans = ans.substring(0,len-2) + "." + ans.substring(len-2,len);
 return ans;
 }
</script>

Regards,
Venkatesan M

On Fri, Nov 14, 2008 at 2:42 AM, Brett Patterson <
[EMAIL PROTECTED]> wrote:

> I hate to ask another question about JavaScript, but I need help with ONE
> more thing, please?
>
> *Using the following JS code in XHTML Transitional:*
> function proc()
>  {
>  var num = document.heartSearch.hsQty.value*8.95;
>  document.hSearchoutput.hsTotal.value = r2(num);
>  }
>
> function prc2()
>  {
>  var num = document.youKnow.cutSandHours.value*12.17;
>  document.outme.soter.value = r2(num);
>  }
>
> function r2(n)
>  {
>  ans = n * 1000;
>  ans = Math.round(ans /10) + "";
>  while (ans.length < 3) {ans = "0" + ans;}
>  len = ans.length;
>  ans = ans.substring(0,len-2) + "." + ans.substring(len-2,len);
>  return ans;
>  }
>
> *and the following HTML code in XHTML Transitional:*
> <div id="oklastone">
> <form action="" name="heartSearch">
> <select name="hsQty" id="hsQty" onchange="proc()">
> <option value="0">0</option>
> <option value="3">3</option>
> </select>
> </form>
> </div>
> <div id="otherrecal">
> <form action="" name="hSearchoutput">
> <input type="text" name="hsTotal" id="hsTotal" value="0.00" />
> </form>
> </div>
> <div id="meinga">
> <form action="" name="youKnow">
> <select name="cutSandHours" id="cutSandHours" onchange="prc2()">
> <option value="1">1</option>
> <option value="5">5</option>
> <option value="6">6</option>
> </select>
> </div>
> <div id="noca">
> <form action="" name="outme">
> <input type="text" name="soter" id="soter" value="0.00" />
> </form>
> </div>
> <div id="costana">
> <form action="" name="costAndTtl">
> <input type="text" name="TtlCost" />
> </form>
> </div>
>
> How would I get the last form to show the SUM of both the id="hsTotal" and
> the id="soter" text fields?
>
> --
> Brett P.
>
> *******************************************************************
> List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
> Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
> Help: [EMAIL PROTECTED]
> *******************************************************************


*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************

Reply via email to