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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using checkboxes dynamically to change a total amount

Status
Not open for further replies.

Bastien

Programmer
May 29, 2000
1,683
CA
I have a form where I have two purchase options. What I want is to check the box and if it clicked assign a value to an input but, if box are clicked to add the totals and so on...see below for code

function Total(){
f=document.orders
Total1=if (f.Locator.value == "Checked")? 19.95:0.00;
Total1=if (f.Teacher.value =="Checked")? Total1+9.95:Total1;
f.Price.value = Total1;
}

thanks

bastien [sig][/sig]
 
whoops!!!
script works...just wasn't set to print into a textbox...sorry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top