Results 1 to 2 of 2

Thread: Simple array question?

  1. #1
    Join Date
    Jun 2007
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Simple array question?

    Probably a simple solution but here is my problem:

    My script

    Code:
    function princ(field,text)
    {
    var text=new Array();
    text[0]="test1";
    text[1]="test2";
    text[2]="test3";
    
    
    
    var e = document.getElementById(field);
    
    e.value=text[text];
    }
    Is called with

    Code:
    princ(PRINCint,1)
    Get en "undefined error". I must try to access the array wrong...but how?

  2. #2
    Join Date
    Jun 2007
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Solved.

    CHanged

    function princ(field,text)

    to

    function princ(field,no)

Bookmarks

Posting Permissions

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