I have a problem that's probably already been answered here but I'm going to ask it anyway.
Here's the deal:
I have an ASP page that sends a NAME of a county to another ASP page as a URL parameter.
--------------------------
---------
COUNTY=name where NAME is a variable from a javascipt that sends the URL to a popup.
Thus the code:
function getCountyFips(name)
{
alert(name); <--- Just for debugging
var windowReference = window.open('county_fips_c
onv.asp?CO
UNTY='+nam
e,'fipsWin
');
if (!windowReference.opener)
windowReference.opener = this.window;
}
Now on the county_fips_conv.asp Page you have this:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/CADTest.
asp" -->
<%
var county_fips__MMColParam = "frederick";
if (String(Request.QueryStrin
g("COUNTY"
)) != "undefined" &&
String(Request.QueryString
("COUNTY")
) != "") {
county_fips__MMColParam = String(Request.QueryString
("COUNTY")
);
//Response.Write(county_fi
ps__MMColP
aram);
}
%>
<%
var county_fips__MMColNbr = "";
var county_fips = Server.CreateObject("ADODB
.Recordset
");
county_fips.ActiveConnecti
on = MM_CADTest_STRING;
county_fips.Source = "SELECT fips FROM dbo.county_fips WHERE county = '"+ county_fips__MMColParam.re
place(/'/g
, "''") + "' ORDER BY fips ASC";
county_fips.CursorType = 0;
county_fips.CursorLocation
= 2;
county_fips.LockType = 1;
county_fips.Open();
var county_fips_numRows = 0;
%>
<html>
<head>
<script language="javascript" type="text/javascript">
function convertFips() {
window.document.forms['FIP
SChild']['
FIPSCODE']
.value = "<%=String(Request.QuerySt
ring("COUN
TY"))%>";
alert(window.document.form
s['FIPSChi
ld']['FIPS
CODE'].val
ue); <--- Shows UNDEFINED
window.opener.document.for
ms['FIPSCh
ild']['fip
sCODE'].va
lue = "<%=(county_fips.Fields.It
em("fips")
.Value)%>"
;
self.close();
}
convertFips();
</script>
<body>
<form id="FIPSChild" name="FIPSChild">
<asp:textbox name="FIPSCODE" type="hidden" />
</form>
</body>
</head>
</html>
<%
county_fips.Close();
%>
--------------------------
----------
--------
I really don't believe I have to send my request to another page but apparently I have to. So the problem lies here:
window.document.forms['FIP
SChild']['
fipsCODE']
.value <--- This causes an error in IE that says: NULL OR NOT AN OBJECT and in FIREFOX it says, IT HAS NO PROPERTIES.
What am I doing wrong???? This is very high priority... so immediate help will get 500 points.
Thanks all...
Peter
Essentially I need to do this:
I'm sending one of 26 county names to retrieve the county's UNIQUE ID code. Once I have that code I can FILTER the Result set.
this is the code that does just that:
//County View
//alert("Master."+part+tar
g+".locati
on='ListCo
untyData.a
sp?pTitle=
"+selObj.o
ptions[sel
Obj.select
edIndex].v
alue+'&'+"
SRCHVAL="+
SrchVal+"&
MM_TARGET=
"+part+"De
tail'");
Master = iFRAME container
part and targ = ListDetail another iFRAME within Master
location will look like this when it's done:
ListCountyData.asp?Title=F
rederickCo
untyView&S
RCHVAL=Fre
derick&Src
hVal=24001
&MM_TARGET
=ListDetai
l
CountyName = The View you'll see
SRCHVAL= County Name
SrchVal = County ID code
MM_TARGET = where the page will open... <--- ListDetail iFRAME
I need to get the 24001 into the SrchVal variable... that's it!!!
Good Luck