ASP with Javascript

K

kelvin

Hi how do I solve this problem.

This code resides in a popup window and when the user click on the
links,
it's suppose to return the value to the main window.

However the code below doesn't work because the <a href> link does not
work at all.

Can someone help? Your help is much appreciated!


<% WHILE NOT recordset_uldType.eof %>
<tr bordercolor="#FFFFFF">
<td width="8%">
<% loc = "javascript:eek:pener.document.forms[1].elements[11].value=" &
recordset_uldType("code") & ";self.close()" %>
<a href="<%=loc%>"> <%=recordset_uldType("code")%></a></td>
<td width="92%<%=recordset_uldType("description")%></td>
</tr>
<% recordset_uldType.movenext
Wend
%>
 
E

Evertjan.

kelvin wrote on 28 apr 2004 in microsoft.public.inetserver.asp.general:
Hi how do I solve this problem.

This code resides in a popup window and when the user click on the
links,
it's suppose to return the value to the main window.

However the code below doesn't work because the <a href> link does not
work at all.

Can someone help? Your help is much appreciated!


<% WHILE NOT recordset_uldType.eof %>
<tr bordercolor="#FFFFFF">
<td width="8%">
<% loc =
"javascript:eek:pener.document.forms[1].elements[11].value=" &
recordset_uldType("code") & ";self.close()" %>
<a href="<%=loc%>"> <%=recordset_uldType("code")%></a></td>
<td width="92%<%=recordset_uldType("description")%></td>
</tr>
<% recordset_uldType.movenext
Wend
%>

Translate this first to readable ASP:


<%
WHILE NOT recordset_uldType.eof
%>

<tr bordercolor="#FFFFFF"><td width="8%">

<%
loc ="javascript:eek:pener.document.forms[1].elements[11].value='"
loc = loc & recordset_uldType("code") & "';self.close()"
%>

<a href="<% = loc%>">
<% = recordset_uldType("code")%>
</a>

</td><td width="92%">
<% = recordset_uldType("description")%>
</td></tr>

<%
recordset_uldType.movenext
Wend
%>

================

1 You missed 2 chars afer the 92%

2 You should have single quotes in the opener...='...'
[caring for spaces inside]

3 it all depends on the contents of your database items.

4 now temporarily change the <a..></a> part to:

<a
href="javascript:eek:pener.document.forms[1].elements[11].value=
'XX';self.close()">
insert XX in the form element
</a>

If this does not work, you have a clientside javascript problem, not an
serverside ASP one or a database one.
 
L

Larry Bud

Hi how do I solve this problem.

This code resides in a popup window and when the user click on the
links,
it's suppose to return the value to the main window.

However the code below doesn't work because the <a href> link does not
work at all.

Can someone help? Your help is much appreciated!


<% WHILE NOT recordset_uldType.eof %>
<tr bordercolor="#FFFFFF">
<td width="8%">
<% loc = "javascript:eek:pener.document.forms[1].elements[11].value=" &
recordset_uldType("code") & ";self.close()" %>
<a href="<%=loc%>"> <%=recordset_uldType("code")%></a></td>
<td width="92%<%=recordset_uldType("description")%></td>
</tr>
<% recordset_uldType.movenext
Wend
%>

This should be in a javascript newsgroup. ASP has nothing to do with
your error.

Your javascript code returns the value to the 11th element in the form
of the page which opens this popup. Have you changed the original
form? Perhaps there is no 11th element, or it's not a text box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top