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

change name

Status
Not open for further replies.

emuye

MIS
Aug 23, 2004
41
US
Here is my question, I would like to modify this code
1- right after you select a year another dorp down menu will enable and ask you to enter the station number and i would like to change this from station number to letting number after i make a year selection.if someone has an idea how i can acomplish that.
thank you








function viewATRStation(){
document.form2.atrstation.disabled=true;
if(document.form2.atrstationyear.value!="" && document.form2.atrstation.value!=""){
var stnum=document.form2.atrstation.value;
var year=document.form2.atrstationyear.value;
var strvalue="ATR"+stnum+".TXT";
window.open(year+"/"+strvalue);
}
else{
if(document.form2.atrstationyear.value=="" && document.form2.atrstation.value!=""){
alert("Please select the year.");
}
else if(document.form2.atrstationyear.value!="" && document.form2.atrstation.value==""){
alert("Please select the station number.");
}
else{
alert("Please select the year and then the station number.");
document.form2.atrstation.disabled=true;
}
}
}












<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Office of Mn/DOT Transportation Data &amp; Analysis - Automatic Traffic Recorder (ATR)</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}
.style1{
font-size:9pt;
font-weight:bold;
color:#663300;
text-align:right;
}
-->
</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="atr.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/green.gif">
<table border="0" cellspacing="0" cellpadding="3" width="739">
<tr>
<td width="168" align="left" valign="top">
<p> <img src="/images/templates/spacer.gif" alt="Mn/DOT Home" width="30" height="71">
<a href="/"><img src="/images/templates/logo.gif" width="71" height="71" alt="Mn/DOT Home" border="0"></a>&nbsp;

<!--This is where you can insert your own navigation items. Begin Here. -->
<font face="Arial, Helvetica, sans-serif, Geneva, Swiss" size="2">
<hr width="128" size="5" align="left">
<table border="0" width="127">
<tr>
<td width="119" bgcolor="#999966" align="center" onmouseover="style.background='#cc9966'; style.color='#0000ff'" onmouseout="style.background='#999966'; style.color='#000000'"><a href="/tda/html/whatsnew.html" style="color:#000000;" onmouseover="style.color='#0000ff'" onmouseout="style.color='#000000'">What's New</a></td>
</tr>
<tr>
<td width="119" align="center" bgcolor="#999966" onmouseover="style.background='#cc9966'; style.color='#0000ff'" onmouseout="style.background='#999966'; style.color='#000000'"><a href="/tda/html/aboutus.html" style="color:#000000;" onmouseover="style.color='#0000ff'" onmouseout="style.color='#000000'">About Us</a></td>
</tr>
<tr>
<td width="119" align="center" bgcolor="#999966" onmouseover="style.background='#cc9966'; style.color='#0000ff'" onmouseout="style.background='#999966'; style.color='#000000'"><a href="/tda/html/sitemap.html" style="color:#000000;" onmouseover="style.color='#0000ff'" onmouseout="style.color='#000000'"> Sitemap</a></td>
</tr>
<tr>
<td width="119" align="center" bgcolor="#999966" onmouseover="style.background='#cc9966'; style.color='#0000ff'" onmouseout="style.background='#999966'; style.color='#000000'"><a href="/tda/html/faq.html" style="color:#000000;" onmouseover="style.color='#0000ff'" onmouseout="style.color='#000000'">FAQ</a></td>
</tr>
<tr>
<td width="119" align="center" bgcolor="#999966" onmouseover="style.background='#cc9966'; style.color='#0000ff'" onmouseout="style.background='#999966'; style.color='#000000'"><a href="/tda/html/glossary.html" style="color:#000000;" onmouseover="style.color='#0000ff'" onmouseout="style.color='#000000'">Glossary</a></td>
</tr>
<tr>
<td width="119" align="center" bgcolor="#999966" onmouseover="style.background='#cc9966'; style.color='#0000ff'" onmouseout="style.background='#999966'; style.color='#000000'"><a href="/tda/html/contactus.html" style="color:#000000;" onmouseover="style.color='#0000ff'" onmouseout="style.color='#000000'">Contact Us</a></td>
</tr>
</table>
</font>
<!--This is where you can insert your own navigation items. End Here. -->
<hr width="128" size="5" align="left"><br>
<b> <a class="nound" href="/"><font face="Arial, Helvetica, sans-serif, Geneva, Swiss" size="2">Mn/DOT
Home <br>
</font></a></b><font face="Arial, Helvetica, sans-serif, Geneva, Swiss" size="2"><a class="nound" href="/information/faq.html">FAQ</a><br>
<a class="nound" href="/information/sitemap.html">Site Map</a><br>
<a class="nound" href=" <a class="nound" href="mailto:info@dot.state.mn.us">Info@DOT</a></font>
<hr width="128" size="5" align="left">
<a href=" src=" width="24" height="62" border="0" alt="Spacer Gif File"><img src="/images/templates/511mn.gif" width="74" height="62" border="0" alt="511mn.org Logo"></a>
</td>
<td valign="top" align="left" background="../images/countyspot.gif" width="559">
<!--===========================main content here==========================================-->
<table border="0" width="100%" height="1001">
<tr>
<td height="122">
<p align="center"><img border="0" src="../images/headerlogo1.jpg" width="510" height="116">
</td>
</tr>
<tr>
<td height="1">
<script language="JavaScript" type="text/javascript">
<!-- hidden from old browsers
document.write(topnav);
//-->
</script>
</td>
</tr>
<tr>
<td bgcolor="#336666" height="3">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#999966" height="3">&nbsp;</td>
</tr>
<tr>
<td bgcolor="#cccccc" height="3"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="#ffffcc" height="129">
&nbsp;</td>
</tr>
<tr>
<td bgcolor="#cccccc" height="3"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td align="center" height="69">
<form name="form3"><!--form3: ATR Station List and Location Maps-->
<table border="0" width="100%">
<tr>
<td colspan="3" class="special" align="center" bgcolor="#cccc99">
&nbsp;</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td bgcolor="#cccccc" height="3"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td bgcolor="#ffffcc" align="center" height="157">
<form name="form2"><!--form2: ATR Hourly Volume-->
<table border="0">
<tr>
<td colspan="4"><img src="../images/spacer.gif" width="1" height="20"></td>
</tr>
<tr>
<td colspan="4" class="special5">Automatic Traffic Recorder (ATR) Hourly Volume (Continuous Count Station)</td>
</tr>
<tr>
<td class="style1">Which year?</td>
<td><select name="atrstationyear" onchange="enabledATRStation();">
<option value="">Select a year</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
</select>
</td>
<td class="style1">ATR Station Number</td>
<td><select name="atrstation" disabled="disabled">
<option value="">Station</option>
</select>
</td>
</tr>
<tr>
<td align="center" colspan="4">
<input type="button" value="View ATR Count " onclick="viewATRStation();" />
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td bgcolor="#cccccc" height="3"><img src="../images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="17"><img src="../images/spacer.gif" width="1" height="15"></td>
</tr>
<tr>
<td align="center" height="152"><br />
</td>
</tr>
<tr>
<td bgcolor="#99ccff" height="3"><img src="../images/spacer.gif" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" height="183"><script language="JavaScript" src="../js/footer.js" type="text/javascript"></script><br />
<hr>

<div align="center">
<p><font face="Arial, Helvetica, sans-serif" size="-2"> <a href="/around.html">Getting
Around</a> | <a href="/news.html">News &amp; Views</a> | <a href="/hot.html">Hot
Topics</a> | <a href="/about.html">About Mn/DOT</a> | <a href="/careers.html">Careers/Jobs</a>
| <a href="/atoz.html">Mn/DOT A-Z</a> | <a href=" href="/construction.html"><br>
</a><a href="/projects/">Projects/Studies</a> | <a href="/business.html">Doing
Business</a> | <a href="/involve.html">Get Involved</a> | <a href="/reslib.html">Research/Library</a>
| <a href="/links.html">Links</a> | <a href="/newtech.html">New Technologies</a><br>
Minnesota Government links: <a href=" | <a href=" Office</a><br>
<br>
&#169;2004 Minnesota Department of Transportation<br>
395 John Ireland Boulevard <b>&#149;</b> St. Paul, MN 55155-1899<br>
Phone: 800/657-3774 <b>&#149; </b>800/627-3529(TTY, Voice, ASCII)</font></p>
<p>&nbsp;</p>
</div>


</td>
</tr>
</table>
<!--=========================================================================-->
</td>
</tr>
</table>
</body>
</html>
 

sorry i forgot to copy this


//Add array here for another year
AtrStation_2002Array=["","008","028","051","053","054","055","056","057",101,103,110,164,170,172,175,179,187,188,191,195,197,198,199,200,204,213,214,218,219,220,221,222,223,225,227,301,303,305,309,315,321,326,329,335,336,341,351,352,353,354,359,365,381,382,384,402,405,407,410,420,422,425,458,460,464];
AtrStation_2003Array=["","008","028","051","053","054","055","056","057",101,102,103,110,164,170,172,175,179,187,188,191,195,197,198,199,200,204,208,209,210,211,212,213,214,218,219,220,221,222,223,225,227,301,303,305,309,315,321,326,329,335,336,341,342,351,352,353,354,359,365,372,381,382,384,386,388,389,390,400,402,405,407,410,420,422,425,458,460,464];
//do not modify after this statement
function makeEnabled(){
var x;
for(x=0; x<4; x++){
if (document.form1.atrdata[x].checked==true){
document.form1.atrdatayear.disabled=false;
}
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top