By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,682 Members | 1,980 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,682 IT Pros & Developers. It's quick & easy.

Need to extract Querystring

P: n/a
fox
Hi,

Lacking javascript knowledge, I just realized why my project has a bug.
I am using ASP to loop through a set of records while it creates URLs
with a querystring that has a single value pair. This URL needs to open
in a floating window if clicked. (this is for an administrator and so
opening a small floater gives them more efficient access to the data that
will be displayed). I now understand that because the ASP executes first,
that is why the querystring that shows up in all the URLs is the last one
thta was resolved in the ASP loop.

This is what I was using within my ASP loop.
<script LANGUAGE="JavaScript">
<!--
function win2()
{
window.open("admin_detail_contact_info.asp?id=<%=d bRecordset
("id")%>","Window2","menubar=no,scrollbars=yes,wid th=375,height=
520,toolbar=no");
}
//-->
</script>
And then

<a href="javascript:win2()" onMouseOver="self.status='Open A Window';
return true;"><%=dbRecordset("lastname") & ", " & dbRecordset
("firstname")%></a>

The above of course keeps repeating in the ASP loop as it should, but the
querystring of course is resolving to the last id resolved in the loop.

I have been searching and reading, but without javascript knowledge I am
not being able to resolve the above. Note that there is another javascript
on the page which forces me to have to use javascript for this. If I do
not, the anchor object will default to the other script because it is a
default for each row in the output. Only by having my URL controlled by
another javascript will it be available without also executing the default
script for the row. If I use a target instead, thereby opening an full new
window, both URLs open simultaneously. This is not an issue, it is an
explanation as to why I cannot just use a simple target and give up the
javascript defined window.

BACK ON TOPIC
I can see that there is a way to parse the querystring using javascript but
the examples are for querystrings with multiple value pairs. I am not able
to both pair that down and also make it work with opening a new window for
the client chosen URL. Can someone help me?

I believe that the following has some of what I need in it if it was
reduced to only resolving the one value pair since I do not need to hunt.
Can someone possibly remove all the code that is unnnecssary for my need
and maybe help me to apply that to creating the final URLs by parse the
querystring that the ASP loops makes and then appendeding that single value
pair to the javascript window.open function similar to or whatever is
needed, to the one posted above.

<script>
function PageQuery(q) {
if(q.length 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if(q) {
for(var i=0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() { return this.keyValuePairs; }
this.getValue = function(s) {
for(var j=0; j < this.keyValuePairs.length; j++) {
if(this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function() {
var a = new Array(this.getLength());
for(var j=0; j < this.keyValuePairs.length; j++) {
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() { return this.keyValuePairs.length; }
}
function queryString(key){
var page = new PageQuery(window.location.search);
return unescape(page.getValue(key));
}
function displayItem(key){
if(queryString(key)=='false')
{
document.write("you didn't enter a ?name=value querystring item.");
}else{
document.write(queryString(key));
}
}
</script>
<body onload="displayItem('name');">
Jul 13 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
fox wrote:
Hi,

Lacking javascript knowledge, I just realized why my project has a bug.
I am using ASP to loop through a set of records while it creates URLs
with a querystring that has a single value pair. This URL needs to open
in a floating window if clicked. (this is for an administrator and so
opening a small floater gives them more efficient access to the data that
will be displayed). I now understand that because the ASP executes first,
that is why the querystring that shows up in all the URLs is the last one
thta was resolved in the ASP loop.

This is what I was using within my ASP loop.
<script LANGUAGE="JavaScript">
The language attribute is deprecated, instead use the type attribute:

<script type = "text/javascript">
<!--
HTML comments are unnecessary and may potentially be harmful.
function win2()
{
window.open("admin_detail_contact_info.asp?id=<%=d bRecordset
("id")%>","Window2","menubar=no,scrollbars=yes,wid th=375,height=
520,toolbar=no");
}
[snip]
>
<a href="javascript:win2()" onMouseOver="self.status='Open A Window';
return true;"><%=dbRecordset("lastname") & ", " & dbRecordset
("firstname")%></a>
The javascript pseudo-protocol is not needed, misused, bad practice,
etc. You can search the newsgroup for more information.

[snip]

Assuming I've understood your problem correctly, all you need to do is
slightly modify what you have above.

javascript:

<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("displayInfo.asp?id=" + id, "displayInfo");

return false;
}
</script>

html:

<%
Do While NOT dbRecordset.EOF
%>

<a href = "displayInfo.asp?id=<%dbRecordset("id")%>">
onclick = "return displayInfo(<%dbRecordset("id")%>">last, first
name</a>

<%
dbRecordset.MoveNext
LOOP

dbRecordset.Close
set dbRecordset = Nothing
%>

This way your loop will generate all the links and the id for each
entry. When the "floater" window opens, it will make a request to your
asp page with the id passed. In your asp page you can easily get the
querystring using ASP's Request object.

In the link above, I've replaced your javascript pseudo-protocol with a
link to the actual page. This provides graceful degradation in case
javascript fails to work.

Jul 13 '06 #2

P: n/a
fox
"web.dev" <we********@gmail.comwrote in
news:11*********************@p79g2000cwp.googlegro ups.com:
HTML comments are unnecessary and may potentially be harmful.
>function win2()
{
window.open("admin_detail_contact_info.asp?id=<%= dbRecordset
("id")%>","Window2","menubar=no,scrollbars=yes,wi dth=375,height=
520,toolbar=no");
}

[snip]
>>
<a href="javascript:win2()" onMouseOver="self.status='Open A Window';
return true;"><%=dbRecordset("lastname") & ", " & dbRecordset
("firstname")%></a>

The javascript pseudo-protocol is not needed, misused, bad practice,
etc. You can search the newsgroup for more information.

[snip]

Assuming I've understood your problem correctly, all you need to do is
slightly modify what you have above.

javascript:

<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("displayInfo.asp?id=" + id, "displayInfo");

return false;
}
</script>

html:

<%
Do While NOT dbRecordset.EOF
%>

<a href = "displayInfo.asp?id=<%dbRecordset("id")%>">
onclick = "return displayInfo(<%dbRecordset("id")%>">last, first
name</a>

<%
dbRecordset.MoveNext
LOOP

dbRecordset.Close
set dbRecordset = Nothing
%>

This way your loop will generate all the links and the id for each
entry. When the "floater" window opens, it will make a request to
your asp page with the id passed. In your asp page you can easily get
the querystring using ASP's Request object.

In the link above, I've replaced your javascript pseudo-protocol with
a link to the actual page. This provides graceful degradation in case
javascript fails to work.

Thanks, this tells me a lot. I also went out and bought a basic book on
Javascript today (G)

I am still having a problem. Here is how I tried to implement your
suggestions. This time I pasted with the true recordset name
to further avoid confusion. I also included the javascript being used in
the TR in case it is relevant. There are a number of rows, doing
different things but they are best left out since they have no
javascript. Here is where I am at this moment.

Thanks again for help you have given

<head>
<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("admin_detail_contact_info.asp?id=" + id, "displayInfo");
return false;
}
</script>
</head>

<%
Do While NOT dbRecordset.EOF
%>
<table>
<tr style="cursor:hand"
onmouseover="this.style.backgroundColor='#C0C0C0'" ;
onmouseout="this.style.backgroundColor='#FFFFFF'";
onClick="location.href='admin_competitors_details. asp?id=<%=objPagingRS
("id")%>&group_id=<%=objPagingRS("group_id")%>' ">

<td width="163" align="center" colspan="2">
<a href="admin_detail_contact_info.asp?id=<%=objPagin gRS("id")%>"
onclick="return displayInfo(<%objPagingRS("id")%>)">
<font size=1 face=verdana><%=UCfirst(objPagingRS("lastname")) & ", " &
UCfirst(objPagingRS("firstname"))%></font></a&nbsp;</td>
</tr>
</table>

<%
objPagingRS.MoveNext
LOOP

objPagingRS.Close
set objPagingRS = Nothing
%>
Jul 13 '06 #3

P: n/a

fox wrote:
"web.dev" <we********@gmail.comwrote in
news:11*********************@p79g2000cwp.googlegro ups.com:
HTML comments are unnecessary and may potentially be harmful.
function win2()
{
window.open("admin_detail_contact_info.asp?id=<%=d bRecordset
("id")%>","Window2","menubar=no,scrollbars=yes,wid th=375,height=
520,toolbar=no");
}
[snip]
>
<a href="javascript:win2()" onMouseOver="self.status='Open A Window';
return true;"><%=dbRecordset("lastname") & ", " & dbRecordset
("firstname")%></a>
The javascript pseudo-protocol is not needed, misused, bad practice,
etc. You can search the newsgroup for more information.

[snip]

Assuming I've understood your problem correctly, all you need to do is
slightly modify what you have above.

javascript:

<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("displayInfo.asp?id=" + id, "displayInfo");

return false;
}
</script>

html:

<%
Do While NOT dbRecordset.EOF
%>

<a href = "displayInfo.asp?id=<%dbRecordset("id")%>">
onclick = "return displayInfo(<%dbRecordset("id")%>">last, first
name</a>

<%
dbRecordset.MoveNext
LOOP

dbRecordset.Close
set dbRecordset = Nothing
%>

This way your loop will generate all the links and the id for each
entry. When the "floater" window opens, it will make a request to
your asp page with the id passed. In your asp page you can easily get
the querystring using ASP's Request object.

In the link above, I've replaced your javascript pseudo-protocol with
a link to the actual page. This provides graceful degradation in case
javascript fails to work.

Thanks, this tells me a lot. I also went out and bought a basic book on
Javascript today (G)

I am still having a problem. Here is how I tried to implement your
suggestions. This time I pasted with the true recordset name
to further avoid confusion. I also included the javascript being used in
the TR in case it is relevant. There are a number of rows, doing
different things but they are best left out since they have no
javascript. Here is where I am at this moment.

Thanks again for help you have given

<head>
<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("admin_detail_contact_info.asp?id=" + id, "displayInfo");
This should be changed to:

window.open("admin_detail_contact_info.asp?id=" + recordId,
"displayInfo");
return false;
}
</script>
</head>

<%
Do While NOT dbRecordset.EOF
I'm assuming you really meant objPagingRS.EOF.
%>
<table>
<tr style="cursor:hand"
onmouseover="this.style.backgroundColor='#C0C0C0'" ;
onmouseout="this.style.backgroundColor='#FFFFFF'";
onClick="location.href='admin_competitors_details. asp?id=<%=objPagingRS
("id")%>&group_id=<%=objPagingRS("group_id")%>' ">

<td width="163" align="center" colspan="2">
<a href="admin_detail_contact_info.asp?id=<%=objPagin gRS("id")%>"
onclick="return displayInfo(<%objPagingRS("id")%>)">
<font size=1 face=verdana><%=UCfirst(objPagingRS("lastname")) & ", " &
UCfirst(objPagingRS("firstname"))%></font></a&nbsp;</td>
</tr>
</table>

<%
objPagingRS.MoveNext
LOOP

objPagingRS.Close
set objPagingRS = Nothing
%>
>From this new perspective, there are few suggestions that I could
offer.

Instead of creating a new table for each entry, just create a new row.
Which would mean you would have to move the <tabletags outside the
loop. Doing this would mean the loop would only create new rows.
(Unless you wanted to create separate tables for each entry on
purpose.)

Secondly, consider using moving your inline styles out and create
classes for them instead. This will improve code readability.

This time around, it appears that when you click on the row, you are
also redirecting the page to admin_competitors_details.asp. Instead of
doing that on the tablerow, you could modify the displayInfo() function
to also accept a group_id. After you open a new window, you can then
redirect the page.

Hope this helps.

Jul 13 '06 #4

P: n/a
fox
"web.dev" <we********@gmail.comwrote in news:1152831694.163283.240220
@m73g2000cwd.googlegroups.com:
><head>
<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("admin_detail_contact_info.asp?id=" + id,
"displayInfo");
>
This should be changed to:

window.open("admin_detail_contact_info.asp?id=" + recordId,
"displayInfo");
GRIN< I noticed that recordId did not appear to have a variable
passed to it, but I struck that from my reply because I did not
want to be presumptuous not knowing javascript. At this point
I am getting first a javascript error and then an ASP error.
I can find neither and surely do not want to post the entire
application page since it is fairly large at 442 lines. Can you
perhaps see anything else that might be failing? Note that without
this scriopting everything runs fine and has been for 2 years.
It is this one thing I cannot get straightened out. I understand if you
are done with this. You have surely tried to help. But in case you are
still up for it here is my next response. and explanation. And below
I posted it as it appears in the page.

>
> return false;
}
</script>
</head>

<%
Do While NOT dbRecordset.EOF

I'm assuming you really meant objPagingRS.EOF.
>%>
Yes I did. That was only in this mocked sample.
><table>
>>From this new perspective, there are few suggestions that I could
offer.

Instead of creating a new table for each entry, just create a new row.
Which would mean you would have to move the <tabletags outside the
loop. Doing this would mean the loop would only create new rows.
(Unless you wanted to create separate tables for each entry on
purpose.)
In the actual application TABLE is outside the Do While loop. I just
shortened things and was trying to put them in some reasonable
environment for view.

Secondly, consider using moving your inline styles out and create
classes for them instead. This will improve code readability.
I have never used classes, but just went and bought a book to get
up on them earlier today. In fact right after writing the first post.
I've been hand coding HTML since 95 and started
using FP in about 2001 or 2. At the time, Style sheets were only
compatible with IE and I never kept up with advances; lived in my own
little world ;)
This time around, it appears that when you click on the row, you are
also redirecting the page to admin_competitors_details.asp. Instead of
doing that on the tablerow, you could modify the displayInfo() function
to also accept a group_id. After you open a new window, you can then
redirect the page.
I included the row URL to make sure you had the whole basic environment.
I need the row URL because this allows the ADMIN to
access the events and misc. purchases for that competitor and I think
its cool. the last programmer on the job had something that worked the
same way and I needed to show I could be cool too ;) The
reason for the second URL is in order to allow the ADMIN
to pull up contact info (email, street address and phone) if they need
it. I am probably telling you waht you already know but the first URL
works on the background anywhere in the row and the
second URL is specific to clicking the name. This has to be separate so
that the purchases can double as a receipt if the ADMIN wants to send a
copy to a competitor.

When I used the window.open both links worked fine, it was just
that the last person resolved became the target for the info. When I
tried to just use an HTML target, when clicked both the row link
and the inline URL would fire. So I knew I had to solve this with
window.open. I am not sure what you interpretation was so I am
not sure I understand your advice in that part. But I do want to
learn and am open to whatever you suggest.

This is the actual environment. I probably should have posted this last
time. Not included there is a function below the loop called Ucfirst
which capitalizes the first letter of each word.

<head>
<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("admin_detail_contact_info.asp?id=" +
recordId,"displayInfo");
return false;
}
</script>

</head>
(Lotsa other stuff in between)

Do While Cint(iRecordsShown) < Cint(iPageSize) AND Not objPagingRS.EOF
<%
pagenumbers = pagenumbers +1
%>
<tr style="cursor:hand"
onmouseover="this.style.backgroundColor='#C0C0C0'" ;
onmouseout="this.style.backgroundColor='#FFFFFF'";
onClick="location.href='admin_competitors_details. asp?id=<%=objPagingRS
("id")%>&group_id=<%=objPagingRS("group_id")%>' ">
<td width="4" align="center"><font size=1 face=verdana>
<%=pagenumbers%>&nbsp;</font></td>
<td width="105" align="center"><font size=1
face=verdana><%=UCfirst(objPagingRS("billTo_lastNa me"))%><br><%=UCfirst
(objPagingRS("group_name"))%>&nbsp;</font></td>
<td width="103" align="center" colspan="2"><font size=1
face=verdana><%=UCfirst(objPagingRS("billTo_firstN ame"))%>&nbsp;</font>
</td>
<td width="163" align="center" colspan="2">
<a href="admin_detail_contact_info.asp?id=<%
=objPagingRS("id")%>" onclick="return displayInfo(<%objPagingRS
("id")%>)">
<font size=1 face=verdana><%=UCfirst(objPagingRS("lastname")) & ", " &
UCfirst(objPagingRS("firstname"))%></font></a&nbsp;</td>

<td width="102" align="center"><font size=1
face=verdana><%=objPagingRS("authorization_code")% ></font>&nbsp;</td>
<td width="72" align="center"><font size=1
face=verdana><%=objPagingRS("date_last_updated")%> &nbsp;</font></td>
<td width="101" align="center" colspan="2"><font size=1
face=verdana><%=objPagingRS("reg_type")%>&nbsp;

<%
If objPagingRS("family_id") 0 Then
Response.Write("- FID" & objPagingRS("family_id"))
End If
If objPagingRS("group_id") 0 Then
Response.Write(" - GID" & objPagingRS("group_id"))
End If
DIM lastname,firstname
lastname = objPagingRS("lastname")
firstname = objPagingRS("firstname")

%>

</font></td>
<td width="58" align="center"><font size=1
face=verdana>$<%=objPagingRS("total_charge")%>&nbs p;</font></td>
<td width="48" align="center"><font size=1
face=verdana>$<%=objPagingRS("fam_total_cost")%>&n bsp;</font></td>
<td width="45" align="center"><a
href="admin_delete_general.asp?
page_back=admin_registration_competitors.asp&id=<% =objPagingRS("id")%>
&last=<%=server.URLencode(objPagingRS("lastname")) %>&first=<%
=server.URLencode(objPagingRS("firstname"))%>
&table_name=registration_new"><font face="Verdana" size="1">Delete</font>
</a></td>
</tr>
<%
iRecordsShown = iRecordsShown+1
' Can't forget to move to the next record!
objPagingRS.MoveNext
Loop
%>
lotsa other stuff below

Regards and thanks,
Dennis
Jul 14 '06 #5

P: n/a
fox
<head>
<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("admin_detail_contact_info.asp?id=" +
recordId,"displayInfo");
return false;
}
</script>

</head>
(Lotsa other stuff in between)

Do While Cint(iRecordsShown) < Cint(iPageSize) AND Not objPagingRS.EOF
<%
pagenumbers = pagenumbers +1
%>
<tr style="cursor:hand"
onmouseover="this.style.backgroundColor='#C0C0C0'" ;
onmouseout="this.style.backgroundColor='#FFFFFF'";
onClick="location.href='admin_competitors_details. asp?id=<%=objPagingRS
("id")%>&group_id=<%=objPagingRS("group_id")%>' ">
<td width="4" align="center"><font size=1
face=verdana>
<%=pagenumbers%>&nbsp;</font></td>
<td width="105" align="center"><font size=1
face=verdana><%=UCfirst(objPagingRS("billTo_lastNa me"))%><br><%=UCfirst
(objPagingRS("group_name"))%>&nbsp;</font></td>
<td width="103" align="center" colspan="2"><font
size=1
face=verdana><%=UCfirst(objPagingRS("billTo_firstN ame"))%>&nbsp;</font>
</td>
<td width="163" align="center" colspan="2">
<a href="admin_detail_contact_info.asp?id=<%
=objPagingRS("id")%>" onclick="return displayInfo(<%objPagingRS
("id")%>)">
<font size=1 face=verdana><%=UCfirst(objPagingRS("lastname")) & ", " &
UCfirst(objPagingRS("firstname"))%></font></a&nbsp;</td>

<td width="102" align="center"><font size=1
face=verdana><%=objPagingRS("authorization_code")% ></font>&nbsp;</td>
<td width="72" align="center"><font size=1
face=verdana><%=objPagingRS("date_last_updated")%> &nbsp;</font></td>
<td width="101" align="center" colspan="2"><font
size=1
face=verdana><%=objPagingRS("reg_type")%>&nbsp;

<%
If objPagingRS("family_id") 0 Then
Response.Write("- FID" & objPagingRS("family_id"))
End If
If objPagingRS("group_id") 0 Then
Response.Write(" - GID" & objPagingRS("group_id"))
End If
DIM lastname,firstname
lastname = objPagingRS("lastname")
firstname = objPagingRS("firstname")

%>

</font></td>
<td width="58" align="center"><font size=1
face=verdana>$<%=objPagingRS("total_charge")%>&nbs p;</font></td>
<td width="48" align="center"><font size=1
face=verdana>$<%=objPagingRS("fam_total_cost")%>&n bsp;</font></td>
<td width="45" align="center"><a
href="admin_delete_general.asp?
page_back=admin_registration_competitors.asp&id=<% =objPagingRS("id")%>
&last=<%=server.URLencode(objPagingRS("lastname")) %>&first=<%
=server.URLencode(objPagingRS("firstname"))%>
&table_name=registration_new"><font face="Verdana"
size="1">Delete</font</a></td>
</tr>
<%
iRecordsShown = iRecordsShown+1
' Can't forget to move to the next record!
objPagingRS.MoveNext
Loop
%>
lotsa other stuff below

Regards and thanks,
Dennis
OK, I just remembered that there was no "=" in order to cause the value
to be printed for the function variable. Yours did not have it and I
thought that it was not supposed to be there. But it just dawned on me
and so I added it. Now it does not error. But what it is doing is both
URLs are firing at the same time. When the individual (for lack a better
word) HREF is clicked, both the row URL and that individual HREF fire.
When I had it wrong before, it did behave and only the Individual HREF
fired. Is there some adjustment we can make to get these to each fire
without the other?

Thanks,
Dennis
Jul 14 '06 #6

P: n/a

"fox" <fo*@connexions.netwrote in message
news:Xn******************************@65.32.5.121. ..
>snip<
BACK ON TOPIC
I can see that there is a way to parse the querystring using javascript
but
the examples are for querystrings with multiple value pairs. I am not able
to both pair that down and also make it work with opening a new window for
the client chosen URL. Can someone help me?
I'm notsure if it will help at all but I've an abstraction component for
dealing with the Query String here:

http://www.depressedpress.com/Conten...ring/Index.cfm

To get the "id" attribute you could do this:

DP_QueryString.get("id", "first");

This will get the value of the first encountered query string variable
called "id".

I use "first" because multiple variables can have the same name in query
strings - this tells the method to just return the value of the first one of
that name found. The default behavior is to get an array of all the values
back.

There's also a method to generate Query Strings from an object (the
properties of the object will become the name=value pairs of the query
string).

There's full documentation and lots of examples at the link I cited.

Jim Davis
Jul 14 '06 #7

P: n/a

fox wrote:
<head>
<script type = "text/javascript">
function displayInfo(recordId)
{
window.open("admin_detail_contact_info.asp?id=" +
recordId,"displayInfo");
return false;
}
</script>

</head>
(Lotsa other stuff in between)

Do While Cint(iRecordsShown) < Cint(iPageSize) AND Not objPagingRS.EOF
<%
pagenumbers = pagenumbers +1
%>
<tr style="cursor:hand"
onmouseover="this.style.backgroundColor='#C0C0C0'" ;
onmouseout="this.style.backgroundColor='#FFFFFF'";
onClick="location.href='admin_competitors_details. asp?id=<%=objPagingRS
("id")%>&group_id=<%=objPagingRS("group_id")%>' ">
<td width="4" align="center"><font size=1
face=verdana>
<%=pagenumbers%>&nbsp;</font></td>
<td width="105" align="center"><font size=1
face=verdana><%=UCfirst(objPagingRS("billTo_lastNa me"))%><br><%=UCfirst
(objPagingRS("group_name"))%>&nbsp;</font></td>
<td width="103" align="center" colspan="2"><font
size=1
face=verdana><%=UCfirst(objPagingRS("billTo_firstN ame"))%>&nbsp;</font>
</td>
<td width="163" align="center" colspan="2">
<a href="admin_detail_contact_info.asp?id=<%
=objPagingRS("id")%>" onclick="return displayInfo(<%objPagingRS
("id")%>)">
<font size=1 face=verdana><%=UCfirst(objPagingRS("lastname")) & ", " &
UCfirst(objPagingRS("firstname"))%></font></a&nbsp;</td>

<td width="102" align="center"><font size=1
face=verdana><%=objPagingRS("authorization_code")% ></font>&nbsp;</td>
<td width="72" align="center"><font size=1
face=verdana><%=objPagingRS("date_last_updated")%> &nbsp;</font></td>
<td width="101" align="center" colspan="2"><font
size=1
face=verdana><%=objPagingRS("reg_type")%>&nbsp;

<%
If objPagingRS("family_id") 0 Then
Response.Write("- FID" & objPagingRS("family_id"))
End If
If objPagingRS("group_id") 0 Then
Response.Write(" - GID" & objPagingRS("group_id"))
End If
DIM lastname,firstname
lastname = objPagingRS("lastname")
firstname = objPagingRS("firstname")

%>

</font></td>
<td width="58" align="center"><font size=1
face=verdana>$<%=objPagingRS("total_charge")%>&nbs p;</font></td>
<td width="48" align="center"><font size=1
face=verdana>$<%=objPagingRS("fam_total_cost")%>&n bsp;</font></td>
<td width="45" align="center"><a
href="admin_delete_general.asp?
page_back=admin_registration_competitors.asp&id=<% =objPagingRS("id")%>
&last=<%=server.URLencode(objPagingRS("lastname")) %>&first=<%
=server.URLencode(objPagingRS("firstname"))%>
&table_name=registration_new"><font face="Verdana"
size="1">Delete</font</a></td>
</tr>
<%
iRecordsShown = iRecordsShown+1
' Can't forget to move to the next record!
objPagingRS.MoveNext
Loop
%>
lotsa other stuff below

Regards and thanks,
Dennis

OK, I just remembered that there was no "=" in order to cause the value
to be printed for the function variable. Yours did not have it and I
thought that it was not supposed to be there. But it just dawned on me
and so I added it. Now it does not error. But what it is doing is both
URLs are firing at the same time. When the individual (for lack a better
word) HREF is clicked, both the row URL and that individual HREF fire.
When I had it wrong before, it did behave and only the Individual HREF
fired. Is there some adjustment we can make to get these to each fire
without the other?

Thanks,
Dennis
Glad to hear you're almost there with a solution. If it worked before,
you could just go back to the way you've had it, that is, have an
onclick event handler for the table row and the onclick event handler
for the link.

As it stands, the onclick event handler for the link is perfectly fine.
For the onclick event handler for the table row however, I would
suggest placing a function call instead. For example:

html:

<tr onclick = "showCompetitorsDetails(<%=objPagingRS("id")%>)"et c...

javascript:

function showCompetitorsDetails(id)
{
location.href = "'admin_competitors_details.asp?id=" + id;
}

Jul 14 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.