Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP with Javascript

Reply
Thread Tools

ASP with Javascript

 
 
kelvin
Guest
Posts: n/a
 
      04-28-2004
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 = "javascriptpener.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
%>
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      04-28-2004
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 =
> "javascriptpener.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 ="javascriptpener.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="javascriptpener.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.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Larry Bud
Guest
Posts: n/a
 
      04-28-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (kelvin) wrote in message news:<(E-Mail Removed). com>...
> 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 = "javascriptpener.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.
 
Reply With Quote
 
Kelvin Teh
Guest
Posts: n/a
 
      04-30-2004
Thanks Evertjan! It works now.

Really thank you very much!



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JavaScript or not JavaScript Mark Rae ASP .Net 36 09-09-2006 01:12 PM
href="javascript:func()" vs href="#" onclick="javascript:func()" CRON HTML 24 06-20-2006 08:05 PM
Javascript -> Applet: variable reset after method call from javascript?! mcdeveloper Java 1 06-13-2006 08:34 AM
asp.net - javascript form values interaction can asp.net read and write to nonasp forms? David Virgil Hobbs ASP .Net 0 01-06-2004 07:09 AM
ASP JavaScript versus ASP VBScript John Davis ASP General 5 09-07-2003 12:42 AM



Advertisments