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!

Script works in IE, but not NS or Firefox?

Status
Not open for further replies.

RoseDa

MIS
Joined
Aug 26, 2004
Messages
12
Location
US
I made the following script to add several drop down selections to get a total and then place the total in the document.
Code:
//Calculates the total of all selections
function GetTotal()
{
    //get variables from form and makes them integers
    var Ami = parseInt(document.voting.Ami.value); 
    var Brady = parseInt(document.voting.Brady.value); 
    var Chad = parseInt(document.voting.Chad.value); 
    var Chris = parseInt(document.voting.Chris.value); 
    var Eliza = parseInt(document.voting.Eliza.value);
    var John_K = parseInt(document.voting.John_K.value);
    var Julie = parseInt(document.voting.Julie.value);
    var Lea = parseInt(document.voting.Lea.value);
    var Leann = parseInt(document.voting.Leann.value);
    var Lisa = parseInt(document.voting.Lisa.value);
    var Rory = parseInt(document.voting.Rory.value);
    var Scout = parseInt(document.voting.Scout.value);
    var Travis = parseInt(document.voting.Travis.value);
    var Twila = parseInt(document.voting.Twila.value);

  
     //adds all variables together to get total
var Gtotal = Ami + Brady + Chad + Chris + Eliza + John_K + Julie + Lea + Leann + Lisa + Rory + Scout + Travis + Twila;
           
     //makes the form element total equal to variable total
     if (Gtotal >= 110) {alert('Total can not be more than 100!');};
      else {document.voting.total.value = Gtotal};
}

Code works in IE, but not Netscape or Firefox?

Any idesa?
Yours,
Dale Rose
 
This looks OK... problem is somewhere in HTML code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top