Results 1 to 3 of 3

Thread: what is wrong with this?

Threaded View

  1. #1
    Join Date
    Dec 2012

    Question what is wrong with this?

    Hello everybody
    Can somebody tell me what is wrong sith this code?
    Very new to JS and about to shoot myself.

    Simple script to pick values form several texboxes (named PMV[1], PMV[2], PMV[3] from form (TTTForm) and add them up and show them in another texbox with click of a button:

    <script type="text/javascript">
    function Addup()
    var PMNUMBR = 3;
    var VTOTAL = 0 ;

    for (var i=1;i<=PMNUMBR;i++)
    VTOTAL = VTOTAL + parseFloat(document.TTTForm["PMV[i]"].value);

    here is the button;

    <input type=button onclick="Addup()" value="Calculate">

    here is the textbox:

    <input type=text name=TotalBox>
    Last edited by JayJava; 12-11-2012 at 10:22 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center