ok
i was able to do this...
seems to work.
but question for you guru's out there.
isn't this kind of Bloated?
shouldn't there be a way to do this with less code?
thanks.
-paul
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html>
<head>
<title>math</title>
<script language='JavaScript'>
function TotalNum_Origionals(obj) // "this" from below gets passed as
"obj"
{
var total = 0;
var amtNum_Origionals =
parseFloat(document.all('Num_Origionals').value);
var amtNum_EachSet =
parseFloat(document.all('Num_EachSet').value);
if ((! isNaN(amtNum_Origionals)) && (!
isNaN(amtNum_EachSet))) { //once "this" is passed, calculate totals
total =
amtNum_Origionals*amtNum_EachSet;
}
document.all('PrintPlotNum').innerHTML = total;
}
function PrintPrice(obj) // "this" from below gets passed as "obj"
{
var total2 = 0;
if ((obj)) { //once "this" is passed,
calculate totals
amt3 =
obj.options[obj.selectedIndex].text; //grabs the text label
instead of the value
PriPri = amt3;
}
document.all('PrintPri').innerHTML = PriPri;
}
function TotalPrintPrice() // "this" from below gets passed as "obj"
{
var TotalPrintPlotNum =
parseFloat(document.all('PrintPlotNum').innerHTML);
var TotalPrintPrice =
parseFloat(document.all('PrintPri').innerHTML);
{ //once "this" is passed, calculate
totals
total3 =
TotalPrintPlotNum*TotalPrintPrice;
}
document.all('PrintPrice').innerHTML = total3;
}
</script>
</head>
<body bgcolor='#FFFFFF' text='#000000' leftmargin='0' topmargin='0'
marginwidth='0' style='font-family: Arial, Helvetica, sans-serif;'
onLoad='TotalNum_Origionals();'>
Num_Origionals
<input type='text' name='Num_Origionals' size='3' maxlength='3'
onChange='TotalNum_Origionals();TotalPrintPrice();'>
<br>
Num_EachSet
<input type='text' name='Num_EachSet' size='3' maxlength='3'
onChange='TotalNum_Origionals();TotalPrintPrice();'>
<br>
Print_Type_ID
<select name='Print_Type_ID'
onChange='PrintPrice(this);TotalNum_Origionals();TotalPrintPrice();'>
<!--- added "this" to send the selected option value --->
<option value='0'>0</option>
<option value='1'>.10</option>
<option value='2'>.20</option>
<option value='3'>.50</option>
<option value='4'>1.00</option>
</select>
<br>
<br>
<br>
Total Number Prints/Plots: PrintPlotNum <strong><SPAN
ID='PrintPlotNum'>0</SPAN></strong>
<br>
Total Cost per Print: PrintPrice <strong><SPAN
ID='PrintPri'>0</SPAN></strong><br>
<br>
<br>
Total Cost for Prints: PrintPrice <strong><SPAN
ID='PrintPrice'>0</SPAN></strong>
</body>
</html>
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists