Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Front Page

Status
Not open for further replies.

arsmjg3

Programmer
Joined
Jul 30, 2001
Messages
1
Location
US
Hi:
I am trying to build a website with Front Page. I am almost done with it. The only thing I need to finish, is the final fields on my order submission form.

What I want to do is to take the value from the item drop down quantity text box, multiply that by the price box, and calculate the total into a "Total" text box.

The final part is to take the items ordered and out put it to text message/box.

I cannot use Visual Basic to create the forms needed, because the web page will not run the exe ?

Can you help ?


 
Goes in the <head> area:[/red]

<SCRIPT language=JavaScript>

//these are my global variables;
var ItemPrice = 10.95;
var SubTotal = &quot;0.00&quot;;
var MyJavaQuantity = &quot;0&quot;;


function formatNum(expr,decplaces) {
var str = (Math.round(parseFloat(expr) * Math.pow(10,decplaces))).toString()

while (str.length <= decplaces) {
str = &quot;0&quot; + str
}
var decpoint = str.length - decplaces
return str.substring(0,decpoint) + &quot;.&quot; + str.substring(decpoint,str.length)
}


function makeSubTotal() {

MyJavaQuantity = document.MYINPUT.MyQuantity.selectedIndex;
SubTotal = ItemPrice * MyJavaQuantity;
SubTotal = formatNum(SubTotal,2);
document.MYINPUT.MySubTot.value = SubTotal;
ProcessOrderForm();

}

This goes on the input type = select

onblur=makeSubTotal()

Try this out. If it does't work email me I will send you the complete cose in it's existing context (too much for here)

chuck@dezinepost.com DeZiner
gear.gif width=45 align=left
When the gears stop turning,
we all stop learning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top