Results 1 to 3 of 3

Thread: how to duplicate a javascript

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    447

    how to duplicate a javascript

    How do you duplicate this in one page?

    Code:
    <script><!--
    
    arChapters = new Array(50,40,27,36,34,24,21,4,31,24,22,25,29,36,10,  13,10,42,150,31,12,8,66,52,5,48,12,14,3,9,1,4,7,3,  3,3,2,14,4,28,16,24,21,28,16,16,13,6,6,4,4,5,3,6,4  ,3,1,13,5,5,3,5,1,1,1,22); // # of chapters in books
    
    
    function loadCombo(cbo, idx) {
     el = null;
     ar = null;
     txt = "";
     
     if(cbo == 1) {
       el = document.f.number;
       ar = arChapters;
       txt = "";
     }
     
     while (el.options.length > 0) {
       for(i=0;i<el.options.length;i++) {el.options[i] = null;}
     }
     
     el.options[el.options.length] = new Option(txt + 1);
     for(i=1;i<=ar[idx-1];i++) {
       el.options[el.options.length] = new Option(txt + i);
     }
     
    }
    // -->
    </script>
    Compare bible texts (and other tools):
    TheWheelofGod

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: how to duplicate a javascript

    Define "duplicate"

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2004
    Posts
    447

    The code works but

    What i'm doing is 2 dropdowns to select a book and then select a chapter. I press search and the text shows in the iFrame. So far it works.

    But when I wanted to compare 2 texts I thought I should include 2 of the codes in 1 page which each had the javascript above (if there was no javascript it would've worked). I think there is a confusion in the Javascript and the name or id of dropdown.

    Is it possible to either make 2 javascripts or to join them?

    DO you want to see them with the dropdowns?
    Compare bible texts (and other tools):
    TheWheelofGod

Posting Permissions

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



Click Here to Expand Forum to Full Width