Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 2nd, 2005, 11:14 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default 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>


Learning of our true origins.

I feel sorry:

http://www.infowars.com/articles/wor...eknowledge.htm

Foreknowledge of A Natural Disaster
Washington was aware that a deadly Tidal Wave was building up in the Indian Ocean
Reply With Quote
  #2 (permalink)  
Old March 3rd, 2005, 04:50 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Can you clarify? What do you mean by duplicate?

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old March 3rd, 2005, 02:03 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

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?

Learning of our true origins.

I feel sorry:

http://www.infowars.com/articles/wor...eknowledge.htm

Foreknowledge of A Natural Disaster
Washington was aware that a deadly Tidal Wave was building up in the Indian Ocean
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validate duplicate Entries using javascript sams ASP.NET 1.0 and 1.1 Professional 3 July 2nd, 2007 03:31 AM
duplicate emails flchen Classic ASP Components 2 February 14th, 2007 09:02 AM
duplicate problem dextermagnific XSLT 1 August 7th, 2006 11:55 AM
Duplicate Records mrookey Dreamweaver (all versions) 1 April 15th, 2005 11:23 AM
Duplicate E-Mails SerranoG Forum and Wrox.com Feedback 3 March 30th, 2004 03:12 PM



All times are GMT -4. The time now is 12:17 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.