|
-
Mar 2nd, 2005, 10:17 PM
#1
Thread Starter
Hyperactive Member
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>
-
Mar 3rd, 2005, 02:22 AM
#2
Re: how to duplicate a javascript
-
Mar 3rd, 2005, 01:04 PM
#3
Thread Starter
Hyperactive Member
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|