Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Please help -- How to run script several times within one document

Reply
Thread Tools

Please help -- How to run script several times within one document

 
 
ThunStorm
Guest
Posts: n/a
 
      02-15-2006
Please help!!! I have a script that I am able to run one time. After
adding a second phase to run the script the script bugs out. How can I
get the script to run several times and pull the same data?

Here is what I am using:

<head>
<title>Untitled</title>
<style type="text/css">
..dropcontent{
width: 300px;
height: 140px;
display:block;
}
</style>

<script type="text/javascript">

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.dropcontent{display:none;}\n')
document.write('</style>\n')
}

function contractall(){
if (document.getElementById){
var inc=0
while (document.getElementById("dropmsg"+inc)){
document.getElementById("dropmsg"+inc).style.displ ay="none"
inc++
}
}
}

function expandone(){
if (document.getElementById){
var selectedItem=document.dropmsgform.dropmsgoption.se lectedIndex
contractall()
document.getElementById("dropmsg"+selectedItem).st yle.display="block"
}
}

if (window.addEventListener)
window.addEventListener("load", expandone, false)
else if (window.attachEvent)
window.attachEvent("onload", expandone)

</script>
================
Here is the body:
<form name="dropmsgform">

<select name="dropmsgoption" size="1" style="width:175"
onChange="expandone()">
<OPTION>Select Team
<OPTION>#1 Lucky Strikes
<OPTION>#2 Morn-D-Lites
<OPTION>#3 Pin-Up's
<OPTION>#4 Pin Pals
<OPTION>#5 Dreamers
<OPTION>#6 Ups + Downs
<OPTION>#7 Alley Cats
<OPTION>#8 Blind
</SELECT>
&nbsp; &nbsp;&nbsp;
<INPUT TYPE=text NAME=ihg1 SIZE=2 MAXLENGTH=4>

<div id="dropmsg0" class="dropcontent">
???
</div>

<div id="dropmsg1" class="dropcontent">
Karen L.
<br>
Marlene T.
<br>
Joyce A.
<br>
Mickey Z.
</div>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Use the same java script several different times in one document in a table moda7884@hotmail.com Javascript 0 02-10-2006 05:45 PM
static block run several times (j2ee, apache tomcat) Jimi Hullegård Java 15 09-06-2005 12:46 AM
search within a search within a search - looking for better way...my script times out Abby Lee ASP General 5 08-02-2004 04:01 PM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57