PDA

View Full Version : Combo Box viewer (Multiple Instances)



julmado
01-26-2007, 12:43 PM
1) Script Title: Combo Box viewer

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/comboviewer.htm

3) Describe problem:

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

I tried just to change the

<form name="dropmsgform">
<select name="dropmsgoption" size="1" style="width:300" onChange="expandone()">
to

<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!

jscheuer1
01-26-2007, 05:20 PM
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.

julmado
01-26-2007, 07:08 PM
Many thanks!

I was looking in that direction as well...

julmado
01-26-2007, 07:11 PM
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?

jscheuer1
01-26-2007, 11:20 PM
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.