adding mutiple values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eLLa enchanted
    New Member
    • Dec 2006
    • 2

    adding mutiple values

    im creating a page that will automatically gets the values inputed in a textfield and automatic add them.
    what can i do to make something like that.

    i started a code something like this but what if there were 1000 of fields..

    heres my code:

    function getVal(){

    var doc = document['oFrm'];
    doc['tot'].value = ((doc['id1'].value)/1) + ((doc['id2'].value)/1);
    }

    -----------------------------------------------------------------------------------

    pls help me... thank you
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by eLLa enchanted
    im creating a page that will automatically gets the values inputed in a textfield and automatic add them.
    what can i do to make something like that.

    i started a code something like this but what if there were 1000 of fields..

    heres my code:

    function getVal(){

    var doc = document['oFrm'];
    doc['tot'].value = ((doc['id1'].value)/1) + ((doc['id2'].value)/1);
    }

    -----------------------------------------------------------------------------------

    pls help me... thank you
    [HTML] for(i = 0 i < 1000;i++) {
    inputName = "input" + i;
    value = document.['formName'].inputName.valu e;
    .....
    }
    [/HTML]

    Comment

    Working...