Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list menu multiple selection

Status
Not open for further replies.

Tee1212

Vendor
Mar 26, 2001
82
0
0
US
I'm trying to create a list menu that the user can select multiple entries to go to different URLS (which are actually zip files for downloading. I want each entry to open a new window with a different URL. I also want a GO button that says "Download Now" to instigate the action.

I can get the list menu to work with multiple selection, but it only lets me open the first URL. Any ideas?

Here's what I have so far (which obviously isn't working):

<p>Select Download Files (hold the shift key down to select multiple files)</p>
<p>
<select name=&quot;downloads&quot; size=&quot;10&quot; multiple&quot;>
<option value=&quot;downloads/image1.zip&quot; selected>Image 1</option>
<option value=&quot;downloads/image2.zip&quot;>Image 2</option>
<option value=&quot;downloads/image3.zip&quot;>Image 3</option>
</select>
<input name=&quot;Download_image&quot; type=&quot;button&quot; onClick=&quot;MM_goToURL('parent');return document.MM_returnValue&quot; value=&quot;Download Now&quot;>
</p>

ANY HELP MUCH APPRECIATED!
 
the problem is with the javascript function. can i have it?
MM_goToURL() thing...

Known is handfull, Unknown is worldfull
 
DW code generated:
------------------whole----------------
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+&quot;.location='&quot;+selObj.options[selObj.selectedIndex].value+&quot;'&quot;);
if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
</head>

<body>
<form name=&quot;form1&quot;>
<select name=&quot;menu1&quot; onChange=&quot;MM_jumpMenu('parent',this,0)&quot;>
<option value=&quot;image1.zip&quot; selected>image1</option>
<option value=&quot;image2.zip&quot;>image2</option>
<option value=&quot;image3.zip&quot;>image3</option>
</select>
<input type=&quot;button&quot; name=&quot;Button1&quot; value=&quot;Go&quot; onClick=&quot;MM_jumpMenuGo('menu1','parent',0)&quot;>
</form>
</body>
</html>
----------------------------------------

all the best!

> need more info?
:: don't click HERE ::
 
sorry u may have to write ur own function...

function OpenWin()
{
len=document.FormName.downloads.length
for(i=0;i<len;i++)
{
if(document.FormName.downloads.selected==true)
{
window.open(document.FormName.downloads.value)
}
}
}

now have a button:
<input type=&quot;button&quot; name=&quot;b1&quot; value=&quot;Download Now&quot; onclick=&quot;OpenWin()&quot;>

Note:FormName - is the name of the form...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top