byterunner
06-19-2003, 11:54 AM
Hi been debating with another programmer on my issue. hope you may put a little more light on my subject.
I have created a web form so that a user can make orders with ease here is the basis of how the page is setup
description (combo box 0-10) Price(textbox)
diskettes combo 7.99
Pencils combo 5.99
so that all my user has to do is choose the number of the specific item she wants from there when she hits TOTAL at the bottom of the page it multiplys the value in the combo box * the price of the item and totals it all up and displays the total in a text box at the bottom.
so this is what i have but it still doesn't pass any values to the text box.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Lyreco Order Form</title>
<script language="javascript">
var diskettes=7.99;
var sony = 8.99;
function do_it()
{
var j=0;
var D1=0;
var totalitemcount = 83
while(j<totalitemcount)
{
var item = "document.order.item"+j+".options[document.order.item.selectedIndex]";
j++;
D1 += Number(eval(item).value)*diskettes;
D1 += Number(eval(item).value)*sony;
}
document.order.display.value = D1;
}
</script>
and here are my input button and textbox at the bottom
<input type="button" value="Total"
"onClick="do_it()"> <input type="text" name="display" size="10"><br>
<br>
</p>
</form>
<p>
</body>
</html>
either tell me i'm on the right track and hopefully tell me what i'm missin......or tell me a different approach.....i'm not a progerammer I have done lots(courses) but i've been a network admin for couple years now without programming
many thanks,
I have created a web form so that a user can make orders with ease here is the basis of how the page is setup
description (combo box 0-10) Price(textbox)
diskettes combo 7.99
Pencils combo 5.99
so that all my user has to do is choose the number of the specific item she wants from there when she hits TOTAL at the bottom of the page it multiplys the value in the combo box * the price of the item and totals it all up and displays the total in a text box at the bottom.
so this is what i have but it still doesn't pass any values to the text box.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Lyreco Order Form</title>
<script language="javascript">
var diskettes=7.99;
var sony = 8.99;
function do_it()
{
var j=0;
var D1=0;
var totalitemcount = 83
while(j<totalitemcount)
{
var item = "document.order.item"+j+".options[document.order.item.selectedIndex]";
j++;
D1 += Number(eval(item).value)*diskettes;
D1 += Number(eval(item).value)*sony;
}
document.order.display.value = D1;
}
</script>
and here are my input button and textbox at the bottom
<input type="button" value="Total"
"onClick="do_it()"> <input type="text" name="display" size="10"><br>
<br>
</p>
</form>
<p>
</body>
</html>
either tell me i'm on the right track and hopefully tell me what i'm missin......or tell me a different approach.....i'm not a progerammer I have done lots(courses) but i've been a network admin for couple years now without programming
many thanks,