Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: sending parametars to function


Message #1 by "dragan" <draganl@s...> on Fri, 11 Oct 2002 21:22:18
Hi
I have database with field productImg(what is name of graphic file) and I  
want to use value of that field to send to function as parametar to open 
newwindow with that graphic file.If user click on my images file to send 
parametar from database to function opennewwind()

I wrote this code and got error  expected ') in the line <A ..

<%
here is asp code
%>

<a href="javascript:void(0)" onclick ="opennewwind(<%=objPagingRS.Fields
("productImg")%>)"><img SRC="zoom_g.gif" ></a>

<SCRIPT LANGUAGE=javascript>
<!--
function opennewwind(filename)
{

}
I using wbscript in asp
Please help
Message #2 by Teng-Fong SEAK <tfseak@f...> on Sun, 13 Oct 2002 16:33:11 +0200
> I have database with field productImg(what is name of graphic 
> file) and I  
> want to use value of that field to send to function as 
> parametar to open 
> newwindow with that graphic file.

	This sentence is too long for me to understand.  But, take a look
here below.

>If user click on my images 
> file to send 
> parametar from database to function opennewwind()
> 
> I wrote this code and got error  expected ') in the line <A ..
> 
> <%
> here is asp code
> %>
> 
> <a href="javascript:void(0)" onclick 
> ="opennewwind(<%=objPagingRS.Fields("productImg")%>)">

	What's the value of objPagingRS.Fields("productImg") ?  I suppose
it's a string.  Didn't you forget to quote the string too?

Try
onclick="opennewwind(<%= "'" & objPagingRS.Fields("productImg") & "'"%>)"

"'" is one double quote + one single quote + one double quote.  Quite hard
to see :-)

><img SRC="zoom_g.gif" ></a>
> 
> <SCRIPT LANGUAGE=javascript>
> <!--
> function opennewwind(filename)
> {
> 
> }
> I using wbscript in asp
> Please help
>  
> tfseak@f...
> %%email.unsub%%
> 
> 
Message #3 by "Dragan Loncar" <draganl@s...> on Sun, 13 Oct 2002 15:41:45 -0400
Thanks Teng
It works
----- Original Message -----
From: "Teng-Fong SEAK" <tfseak@f...>
To: "ASP components" <asp_components@p...>
Sent: Sunday, October 13, 2002 10:33 AM
Subject: [asp_components] RE: sending parametars to function


> > I have database with field productImg(what is name of graphic
> > file) and I
> > want to use value of that field to send to function as
> > parametar to open
> > newwindow with that graphic file.
>
> This sentence is too long for me to understand.  But, take a look
> here below.
>
> >If user click on my images
> > file to send
> > parametar from database to function opennewwind()
> >
> > I wrote this code and got error  expected ') in the line <A ..
> >
> > <%
> > here is asp code
> > %>
> >
> > <a href="javascript:void(0)" onclick
> > ="opennewwind(<%=objPagingRS.Fields("productImg")%>)">
>
> What's the value of objPagingRS.Fields("productImg") ?  I suppose
> it's a string.  Didn't you forget to quote the string too?
>
> Try
> onclick="opennewwind(<%= "'" & objPagingRS.Fields("productImg") & "'"%>)"
>
> "'" is one double quote + one single quote + one double quote.  Quite hard
> to see :-)
>
> ><img SRC="zoom_g.gif" ></a>
> >
> > <SCRIPT LANGUAGE=javascript>
> > <!--
> > function opennewwind(filename)
> > {
> >
> > }
> > I using wbscript in asp
> > Please help
> >
> > tfseak@f...
> > %%email.unsub%%
> >
> >
>
>
%%email.unsub%%
>
>



  Return to Index