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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Button

Status
Not open for further replies.

korata

Technical User
Aug 24, 2004
38
US
i want to make a selection using a radio button whether it is a metric system or not by clicking the first button. my question is how can i make the second button to be used to download the zip file i have on my folder.if someone has an idea please help.


function forecasts(){
var map1=document.frmForecast.forecast[0];
var map2=document.frmForecast.forecast[1];
if(map1.checked!=false || map2.checked!=false){
for(x=0;x<2; x++){
if(document.frmForecast.forecast[x].checked==true){
var forecastname=document.frmForecast.forecast[x].value;
window.open("maps/forecast/"+forecastname+".pdf");
}
}
}
else{
alert("Please select Statewide or Metro Area.");
}










<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<title> Homepage</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<!--Your Header information should be copied into this location replacing the information between the first <head> under the <html> and the </head> right under this statement. -->

<STYLE TYPE="text/css">
<!--.nound{text-decoration:none}-->
</STYLE>
<style type="text/css">
<!--
a {
text-decoration:none;
}
a:hover {
color:#8b0000;
font-style:normal;
font-family:Arial;
}
body {
font-family:Arial, Helvetica, sans-serif, Geneva, Swiss, SunsSans-Regular;
}
.format1 {
font-weight:bold;
}
clr {
color:#ffffff;
}
-->
</style>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/topnav.js" type="text/javascript"></script>
<script language="JavaScript" src="js/maps.js" type="text/javascript"></script>
</head>

<!--This style code defines a class named "nound" which is easier to type than 'style="text-decoration:none"' -->

<body bgcolor="#FFFFFF" background="/images/templates/blue.gif">
<table border="0" cellspacing="0" cellpadding="3" summary="">
<tr>
<td width="132" align="left" valign="top">
<!--#include virtual="/ssi/logo.html" -->
<!--This is where you can insert your own navigation items. Begin Here. -->
<!--#include virtual="ssi/leftnavigationgreen2.html" -->
<!--This is where you can insert your own navigation items. End Here. -->
<hr width="128" size="5" align="left"><br>
<!--#include virtual="/ssi/main.html" -->
</td>
<td valign="top" align="left">
<!--=====================================main content here=========================================-->
<table border="0" width="52" height="177">
<tr>
<td height="125" width="608">
<p align="center">
<img border="0" src="images/headerlogo1.jpg" width="600" height="116" alt="Bid Letting Website Logo">
</td>
</tr>
<tr>
<td>
<script language="JavaScript" type="text/javascript">
<!-- hidden from old browsers
document.write(topnav);
//-->
</script>
</td>
</tr>
<tr>
<td bgcolor="#93C9FF"><img src="../html/images/spacer.gif" height="1"></td>
</tr>
<tr>
<td align="center" class="format3">Transport Item List </td>
</tr>
<tr>
<td bgcolor="#93C9FF"><img src="../html/images/spacer.gif" height="1"></td>
</tr>
<tr>
<td>
<table border="0" width="600" background="../images/countyspot.gif">
<tr>
<td class="special2">
<table border="0" width="600" background="../images/countyspot.gif">
<tr>
<td>
<ul>
<li>Master Trns*port Item List for Mn/DOT projects
using English Items and Spec. Year 2000.(This list
went into effect with the 2000 Spec. Book.)</li>
</ul>
<ul>
<li>Master Trns*port Item List&nbsp;for Mn/DOT projects
using Metric Items and Spec. Year 2000.(This list
went into effect with the 2000 Spec. Book.)<br>
<br>
<br>
<br>
The METITM01.CSV (Comma Separated Value) file in the
METITM01.ZIP file can be imported into a
spreadsheet.</li>
</ul>
</td>
</tr>
<tr>
<td align="center">
<form name="frmForecast">
<input type="radio" name="forecast" value="engitm00">English
<input type="radio" name="forecast" value="metitm01">Metric&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </input>&nbsp;
<input type="button" value="View in PDF format" onclick="forecasts();" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="Download Zip file" onclick="forecasts();" /></form>
</td>
</tr>
<tr>
<td align="center">Contact: Todd&nbsp; (651)296-8535<br />
<a href="mailto:tod.berr@dot.state.mn.us">todd.ber@dot.state.mn.us</a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center"><br />
<blockquote>&nbsp;</blockquote>
</td>
</tr>
<tr>
<td bgcolor="#93C9FF"><img src="../html/images/spacer.gif" width="1" height="1" /></td>
</tr>
<tr>
<td align="center"><script language="JavaScript" src="js/footer.js" type="text/javascript"></script><br />
<!--#include virtual="/ssi/footer.html" -->
</td>
</tr>
</table>
<!-------------------------------------------main content end here--------------------------->
</td>
</tr>
</table>
</body>
</html>
 
What happens now when you try it?

It appears that from what you are saying, you have a zip file containing a pdf that you want to download?

If that is the case...

You would need to change

window.open("maps/forecast/"+forecastname+".pdf");

to

window.open("maps/forecast/" + forecastname + ".zip");

assuming that the zip file, like the pdf file, is named the same way, matching up to the values of the radio buttons.


ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top