How do I create a pop up window within ASP code?

M

mmac

I am trying to create something like this:
Response.Write "<a
href=""javascript:eek:penWindow('www.domain.com/events/EventDetails.asp?EventID=" &
rsEvents("OccID") &
"','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')"">"

I know there is something wrong with the above, the example I drew from used
"/dsn/wwwdomaincom" and I don't know what to do with "dsn" so I am trying to
figure out how to make it work without it.

I would like to create a seperate function for the "open.window" function but
every attempt I make doesn't allow the params "& rsEvents("OccID") " to work. I
am giving up on this approach and hoping I can do the same thing from ASP
instead.

How do I create a seperate function that I can re-use in other places that will
allow this extended information to be passed? Javascript or ASP is fine. I just
can seem to get over this hill.
 
B

Brynn

<%
theEventID = "1234" 'rsEvents("OccID")
theLinkText = "Your Link"
Response.Write "<a href=""#""
onClick=""window.open('www.domain.com/events/EventDetails.asp?EventID="
& theEventID &
"','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')"">"
& theLinkText & "</a>"
%>

Brynn
www.coolpier.com








I am trying to create something like this:
Response.Write "<a
href=""javascript:eek:penWindow('www.domain.com/events/EventDetails.asp?EventID=" &
rsEvents("OccID") &
"','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')"">"

I know there is something wrong with the above, the example I drew from used
"/dsn/wwwdomaincom" and I don't know what to do with "dsn" so I am trying to
figure out how to make it work without it.

I would like to create a seperate function for the "open.window" function but
every attempt I make doesn't allow the params "& rsEvents("OccID") " to work. I
am giving up on this approach and hoping I can do the same thing from ASP
instead.

How do I create a seperate function that I can re-use in other places that will
allow this extended information to be passed? Javascript or ASP is fine. I just
can seem to get over this hill.

I participate in the group to help give examples of code. I do not guarantee the effects of any code posted. Test all code before use!

Brynn
www.coolpier.com
 
R

Roji. P. Thomas

JS

function openPopup(ID)

{

var url = "yourURL?Id=" + ID

window.open(urlyWindow','width=500,height=440,left=150,top=80,directories=no
,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no');

}

ASP
Response.Write "<A href = 'javaScript:eek:penPopup(" & Rs("ID") * ")';>"


QL Server Programmer
--------------------------------------
mmac said:
I am trying to create something like this:
Response.Write "<a
href=""javascript:eek:penWindow('www.domain.com/events/EventDetails.asp?EventID
=" &
 
M

mmac

Roji
I had to modify a bit to make the vars correct and may have messed it up
some. I tried the following but keep getting the following error in the
browser:
runtime error '800a000d' Type mismatch: '[string: ")';>"]'

JS
<script>
function openPopup(ID)

{

var url = "www.mydomain.com/events/eventdetails.asp?EventId=" + ID


window.open(urlyWindow','width=500,height=440,left=150,top=80,directories=no
,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no');

}
</script>
ASP
Response.Write "<a href = 'javaScript:eek:penPopup(" & RsEvents("OccID") *
")';>"
 
M

mmac

I modified your example to fit and came up with the following:

theEventID = rsEvents("OccID")
theLinkText = rsEvents("EventName")
Response.Write "<a
href=""javascript:window.open('www.mydomain.com/events/EventDetails.asp?Even
tID=" & theEventID &
"','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')""
" & theLinkText & "</a>"

This presents the following as a link as shown in the bottom of the browser:

javascript:window.open('www.mydomain.com/events/EventDetails.asp?EventID=215
73673','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500
')

which looks good to me except for the javascript window.open at the
beginning bnut for all i know that could be normal too.

Brynn said:
<%
theEventID = "1234" 'rsEvents("OccID")
theLinkText = "Your Link"
Response.Write "<a href=""#""
onClick=""window.open('www.domain.com/events/EventDetails.asp?EventID="
& theEventID &
"','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')""
"
& theLinkText & "</a>"
%>

Brynn
www.coolpier.com










href=""javascript:eek:penWindow('www.domain.com/events/EventDetails.asp?EventI D=" &

I participate in the group to help give examples of code. I do not
guarantee the effects of any code posted. Test all code before use!
 
B

Brynn

Sorry, I lost my mind a sec ...

change

href=""#"" onClick=""window.open(' ... etc...



I modified your example to fit and came up with the following:

theEventID = rsEvents("OccID")
theLinkText = rsEvents("EventName")
Response.Write "<a
href=""javascript:window.open('www.mydomain.com/events/EventDetails.asp?Even
tID=" & theEventID &
"','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500')""

This presents the following as a link as shown in the bottom of the browser:

javascript:window.open('www.mydomain.com/events/EventDetails.asp?EventID=215
73673','Today','status=yes,scrollbars=yes,resizable=yes,width=500,height=500
')

which looks good to me except for the javascript window.open at the
beginning bnut for all i know that could be normal too.


guarantee the effects of any code posted. Test all code before use!

Brynn
www.coolpier.com

I participate in the group to help give examples of code.
I do not guarantee the effects of any code posted.
Test all code before use!
 
M

mmac

That looks like what you had originally if I recall right and it did
something odd.... can't recall what it was... I'll try it again tonight.
thanks for the help I really appreciate it.
I need to find a syntax checker for this stuff
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top