Results 1 to 5 of 5

Thread: Combo Box viewer (Multiple Instances)

  1. #1
    Join Date
    Sep 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Combo Box viewer (Multiple Instances)

    1) Script Title: Combo Box viewer

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...omboviewer.htm

    3) Describe problem:

    I'd like to put more than one on a page.

    I tried just to change the
    Code:
    <form name="dropmsgform">
    <select name="dropmsgoption" size="1" style="width:300" onChange="expandone()">
    to
    Code:
    <form name="dropmsgform2">
    <select name="dropmsgoption2" size="1" style="width:300" onChange="expandone()">
    and subsequent numbers.

    What happens is the whole content is displayed once the HTML is loaded, not just the selected option.

    I'm sure this is so simple!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Nope, not simple. The script is single function oriented. It would need to be converted to a multiple object capable oriented script to be reusable on the same page. Another option would be to write another copy of the same script replacing all unique global function, id and variable names with a new set and then essentially run both scripts on one page. The easiest way, as it is written, would be to have just one on the page - to add others, put them on separate pages and allow them to show through onto the first page via an iframe.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Many thanks!

    I was looking in that direction as well...

  4. #4
    Join Date
    Sep 2005
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Only thing is... I was hoping this would be a single HTML file instead of having independant files to fill in the main page.

    Maybe tables?

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Nope. It is by virtue of having separate pages that you can easily avoid the inevitable conflicts of the unprotected global function, variable and id names inherent in multiple uses of the script.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •