<html>
<head>
<title>א"ב בבנית אתרים</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8">
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Paul Brino (irandd@aol.com) --> <!--
This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com
-- הפמ חוקל טפירקסה -->
<!-- Begin
function checkChoice(whichbox) {
with (whichbox.form) {
if (whichbox.checked == false)
hiddentotal.value = eval(hiddentotal.value) - eval(whichbox.value);
else
hiddentotal.value = eval(hiddentotal.value) + eval(whichbox.value);
return(formatCurrency(hiddentotal.value));
}
}
function formatCurrency(num) {
<!-- Function courtesy of: Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site: http://www7.ewebcity.com/cyanide7 -->
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num)) num = "0";
cents = Math.floor((num*100+0.5)%100);
num = Math.floor((num*100+0.5)/100).toString();
if(cents < 10) cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
return ("$" + num + "." + cents);
}
// End -->
</script>
<link rel="stylesheet" href="../liora3.css">
</head>
<body >
<table width="80%" border="1" cellspacing="2"
cellpadding="2" align="center" bgcolor="#ece8cf"
bordercolor="#666666" class="bord2">
<tr>
<td align="center"> .םכסמ ספוט </td>
<tr>
<td align="left"><table>
<tr>
<td>
<form name=myform>
<pre>
<b>Example 1</b>
Steak $15.25 <input type=checkbox name=Steak value="15.25"
onClick="this.form.total.value=checkChoice(this);">
Chicken $12.39 <input type=checkbox name=Chicken value="12.39"
onClick="this.form.total.value=checkChoice(this);">
Sushi $18.75 <input type=checkbox name=Sushi value="18.75"
onClick="this.form.total.value=checkChoice(this);">
<br>
Your total is: <input type="text" name="total"
value="" size=6 readonly><input type=hidden name=hiddentotal
value=0>
</pre>
</form>
<hr width="100%" noshsde>
<form name=myform2>
<pre>
<b>Example 2</b>
Tea $ .50 <input type=checkbox name=Tea value=".50" onClick="this.form.total.value=checkChoice(this);">
Cola $ .79 <input type=checkbox name=Cola value=".79" onClick="this.form.total.value=checkChoice(this);">
Coffee $ 1.75 <input type=checkbox name=Coffee value="1.75"
onClick="this.form.total.value=checkChoice(this);">
<br>
Your total is: <input type="text" name="total"
value="" size=6 readonly><input type=hidden name=hiddentotal
value=0>
</pre>
</form>
</td>
</tr>
</table>
</td>
<tr>
<td align="left"> </td>
</table>
</body>
</html>
|