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!

Several functions in one page

Status
Not open for further replies.

emokid

Technical User
Oct 25, 2000
5
0
0
BE
Hi,

I wrote a function go that redirects you to the item you selected out of a drop down list. The function works perfect if you put it on a seperate page. If you put it in a page with another function, I get the message "document.frmBrowseByRegion has no properties."
I can't see any reason why this happens. I'll put the code underneath. Please help !!!

------ the script ----------
<Script language=&quot;JavaScript&quot;>
function goBrowseByRegion()
// Description: Select a continent out of the TravelguideDatabase
// Written: Jan Van Weert, 6 Nov 2000
// (c)2000 @itCONSULT

{
if (navigator.appName == &quot;Netscape&quot;)
{
//document.frmBrowseByRegion.submit();
if (document.frmBrowseByRegion.optBrowseByRegion.options[document.frmBrowseByRegion.optBrowseByRegion.selectedIndex].value != 0)
{
var optBrowseByRegion = document.frmBrowseByRegion.optBrowseByRegion.options[document.frmBrowseByRegion.optBrowseByRegion.selectedIndex].value;
document.location.href=&quot;default.asp?iRegion=&quot; + optBrowseByRegion
}
}
else
{
if (document.frmBrowseByRegion.optBrowseByRegion.value !=0)
{
var optBrowseByRegion = document.frmBrowseByRegion.optBrowseByRegion.value;
document.location.href=&quot;default.asp?iRegion=&quot; + optBrowseByRegion
}
}

}
</Script>

------------ inside the body ---------
<table border=&quot;0&quot;>
<tr>
<td valign=&quot;bottom&quot;><font size=&quot;-1&quot;>Browse Region</font></td>
</tr>
<tr>
<td valign=&quot;top&quot;>
<FORM STYLE=&quot;margin:0&quot; NAME=&quot;frmBrowseByRegion&quot; METHOD=&quot;POST&quot;>
<select name=&quot;optBrowseByRegion&quot; onChange=&quot;javascript: goBrowseByRegion()&quot;>
<option value=&quot;&quot; selected>Select Region</option>
<%Do While Not rstMajReg.EOF%>
<option value=&quot;<%=rstMajReg(0)%>&quot;><%=rstMajReg(1)%></option>
<%
rstMajReg.MoveNext
Loop
%>
</select>
</FORM>
</tr>
</table>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top