473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

ASP Link query...

Hi,

Quick question.

I have the following link:

<A HREF=""Schedule.asp?JobNumber=" & RS("JobNumber") & "&PONumber=" &
RS("PONumber") & """>" & RS("JobNumber") ONCLICK= popup() & "</a>
I want the link to reference a function in the <Script> tag as
follows:

<script>

function popup() {
window.open( "Schedule.asp" , ""
,"top=40,left=40,width=200,height=100" ) ;
}

</script>

I am not sure where to place the ONCLICK code in the hyperlink as this
link is written out via response.write......Its all the " " & ' ' that
get me ...

Thanks in advance
David
Jul 19 '05 #1
2 1298
If you want the popup to happen when the page displays, call popup in the
<body> tag. You can either load the script with ASP or the body tag. If you
load the body tag, you will have to make the function accept the vars as
params.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
"David" <da***@scene-double.co.uk> wrote in message
news:c1**************************@posting.google.c om...
Hi,

Quick question.

I have the following link:

<A HREF=""Schedule.asp?JobNumber=" & RS("JobNumber") & "&PONumber=" &
RS("PONumber") & """>" & RS("JobNumber") ONCLICK= popup() & "</a>
I want the link to reference a function in the <Script> tag as
follows:

<script>

function popup() {
window.open( "Schedule.asp" , ""
,"top=40,left=40,width=200,height=100" ) ;
}

</script>

I am not sure where to place the ONCLICK code in the hyperlink as this
link is written out via response.write......Its all the " " & ' ' that
get me ...

Thanks in advance
David

Jul 19 '05 #2
In article <c1**************************@posting.google.com >, David
<da***@scene-double.co.uk> writes
<A HREF=""Schedule.asp?JobNumber=" & RS("JobNumber") & "&PONumber=" &
RS("PONumber") & """>" & RS("JobNumber") ONCLICK= popup() & "</a>


Just as an aside, this will generate invalid HTML. This might not cause
problems for the majority, but will do so for some people (like Netscape
4.x users !!).

When building URLs, you must use HTML characters in place of things like
&. Don't have ...

<a href="mypage.asp?id=12&type=ferret">click here</a>

use ...

<a href="mypage.asp?id=12&amp;type=ferret">click here</a>

Note that the "&" has been changed to the HTML equivalent of &amp;
(don't forget the ; at the end). Failure to do this can cause some
browser to incorrectly interpret the & as the start of a special
character sequence. In the above case, it would think that &type is
supposed to be an HTML entity and not know what to do with it. This may
cause the URL to be incorrectly parsed.

I would build the full URL in a string variable, then user
Server.HTMLEncode on it before writing it out.

HTH

--
Alan Silver
(anything added below this line is nothing to do with me)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Acorn Tutors | last post by:
Hi folks, what I would like to do is to store the name of a link, such as link1.php in a field, lets say the field is called Favoritelinks, in a database as a bit of text. Then, on a logged in...
4
by: Dodo | last post by:
Is it possible to create a link that can post a value to an ASP page without java?
3
by: Dr. Oz | last post by:
Hi, I am trying to read in a query string from one page and build a link to another page based on the query string. Here's the code I am using to read in the query string: <script...
4
by: Ian Davies | last post by:
Hello I have seen some tutorials to put a update a counter field in a record. I have the counter field in a table that also has a field for a path to file. I display the records in a table on...
3
by: printline | last post by:
Hello All I have a table with some information in the rows on orders placed by my customers. Each column in the table represents some data on the product in the row. What i want to do is make...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.