hey there-- i started learning javascript all of yesterday and i am having a hard time with this script i am writing. i want the links to open a particular page while submitting the form that will pass a hidden field. i keep getting the default page, however, not the page i want. here is my script (it is actually an html embedded in a perl script but this is just the former):
<HTML>
<HEAD><TITLE>Gaging Station Inventory Database</TITLE>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
function SubmitForm(selectedPage)
{
document.autosubmit.page.value = selectedPage;
document.autosubmit.submit();
}
function openPage(selectedPage)
{
switch(selectedPage) {
case "retrieve":
window.location="http://oregon.usgs.gov/uo/safety/gagehouse/retrieve.pl";
break;
case "docs":
window.location="http://oregon.usgs.gov/uo/safety/gagehouse/docs.pl";
break;
case "update":
window.location="http://oregon.usgs.gov/uo/safety/gagehouse/update.pl";
break;
case "pictures":
window.location="http://oregon.usgs.gov/uo/safety/gagehouse/pictures.pl";
break;
case "home":
window.location="http://oregon.usgs.gov/uo/safety/gagehouse/home.pl";
break;
default:
window.location="http://oregon.usgs.gov/uo/safety/gagehouse/station_home.html";
}
}
-->
</SCRIPT>
</HEAD>
<BODY bgcolor="#004444" text="#cc6600" vlink="#cc6600" link="#cc6600" alink="#cc6600">
<IMG alt="USGS: science for a changing world" WIDTH=478 HEIGHT=70
SRC="http://oregon.usgs.gov/Imgs/Markup/gifs/usgs_banner.gif" frame=0>
<BR>
<BR>
<BR>
<TABLE border=0 cellpadding=25 width=100%>
<TR><TD colspan=6 align=center valign=top width=15% bgcolor="#004444" text="#cc6600" vlink="#cc6600" link="cc6600">
<H3>CONTENTS</H3><BR>
<FORM NAME=autosubmit METHOD="post" ACTION=javascriptpenPage()>
<INPUT TYPE="hidden" NAME="name" VALUE=$name{$FORM{'name'}}>
<INPUT TYPE="hidden" NAME="page">
<A HREF="javascript:SubmitForm('retrieve')">Retrieve Data</A><BR><BR>
<A HREF="javascript:SubmitForm('docs')">View Safety Documents</A><BR><BR>
<A HREF="javascript:SubmitForm('update')">Update Station Data</A><BR><BR>
<A HREF="javascript:SubmitForm('pictures')">View Pictures</A><BR><BR>
<A HREF="javascript:SubmitForm('home')">Site Home</A><BR><BR>
<A HREF="http://oregon.usgs.gov/uo/safety/gagehouse/station_home.html">Change Site</A>
</TD>
<TD bgcolor="#cccc99" text="#003300" vlink="#dd9911" link="#0033aa" align=center cellspacing=100 cellpadding=200>
$name{$FORM{'name'}}
</FORM>
</TD>
</TABLE>
</BODY>
</HTML>



penPage()>


Bookmarks