473,385 Members | 1,468 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 Hyperlink with Javascript problem...

Hi,

I have text link on each record displayed. This needs to open a new
small window for entering some data, I cannot seem to fix it ?

Hyperlink Code as is:

..... RS("Manual") & "</td><td><a
href=javascript:onclick=NewWindow('JobSerial.asp?J obNumber=" &
RS("JobNumber") & "', 700, 600)>Create JobSheet</a></TD></TR>"

Javascript function in HEAD as is:

<script LANGUAGE="JavaScript">
<!--//
function NewWindow(pagename, pwidth, pheight) {
if (!pwidth) {
pwidth = 600
}
if (!pheight) {
pheight = 480
}
msgWindow=window.open(pagename,"quality","toolbar= no,width=" + pwidth
+ ",height=" + pheight +
",directories=no,status=no,scrollbars=yes,resizabl e=no,menubar=no");
}
//-->
</script>

_____________________________

Please let me know what I have done wrong.
David
Jul 21 '05 #1
6 3515
On 20 Oct 2004 04:58:26 -0700, da***@scene-double.co.uk (David) wrote:
I have text link on each record displayed. This needs to open a new
small window for entering some data, I cannot seem to fix it ?

Hyperlink Code as is:

.... RS("Manual") & "</td><td><a
href=javascript:onclick=NewWindow('JobSerial.asp? JobNumber=" &
RS("JobNumber") & "', 700, 600)>Create JobSheet</a></TD></TR>"

Javascript function in HEAD as is:

<script LANGUAGE="JavaScript">
<!--//
function NewWindow(pagename, pwidth, pheight) {
if (!pwidth) {
pwidth = 600
}
if (!pheight) {
pheight = 480
}
msgWindow=window.open(pagename,"quality","toolbar= no,width=" + pwidth
+ ",height=" + pheight +
",directories=no,status=no,scrollbars=yes,resizab le=no,menubar=no");
}
//-->
</script>

_____________________________

Please let me know what I have done wrong.


Posted a client-side Javascript question in a server-side ASP group.
Try a JavaScript group to help you code however you wish this to
happen.

Jeff
Jul 21 '05 #2

Jeff,

This is an ASP question. I'm trying to get the Javascript working with
my ASP script....hence my posting on the ASP Group.

If it was straight javascript fair enough.....but it is not.

I'm writing out records via asp, and cannot get the link working within
my ASP CODE.

Please read my post again before trying to tell people off.
David.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
Shouldn't it be <% =RS("JobNumber") %>?

Are you forgetting the <% %> tags?

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

I have text link on each record displayed. This needs to open a new
small window for entering some data, I cannot seem to fix it ?

Hyperlink Code as is:

.... RS("Manual") & "</td><td><a
href=javascript:onclick=NewWindow('JobSerial.asp?J obNumber=" &
RS("JobNumber") & "', 700, 600)>Create JobSheet</a></TD></TR>"

Javascript function in HEAD as is:

<script LANGUAGE="JavaScript">
<!--//
function NewWindow(pagename, pwidth, pheight) {
if (!pwidth) {
pwidth = 600
}
if (!pheight) {
pheight = 480
}
msgWindow=window.open(pagename,"quality","toolbar= no,width=" + pwidth
+ ",height=" + pheight +
",directories=no,status=no,scrollbars=yes,resizabl e=no,menubar=no");
}
//-->
</script>

_____________________________

Please let me know what I have done wrong.
David

Jul 21 '05 #4
I think so! Look at the HTML source using View Source.

If the source looks incorrect (and I think it does), then it's an ASP
question. If the source looks correct and the JavaScript doesn't do what you
want, then it's a JavaScript problem.

I think you might be getting ASP and JavaScript a tad mixed up.

Paul

"Jeff Dillon" <je**@removeemergencyreporting.com> wrote in message
news:eE**************@TK2MSFTNGP14.phx.gbl...
Shouldn't it be <% =RS("JobNumber") %>?

Are you forgetting the <% %> tags?

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

I have text link on each record displayed. This needs to open a new
small window for entering some data, I cannot seem to fix it ?

Hyperlink Code as is:

.... RS("Manual") & "</td><td><a
href=javascript:onclick=NewWindow('JobSerial.asp?J obNumber=" &
RS("JobNumber") & "', 700, 600)>Create JobSheet</a></TD></TR>"

Javascript function in HEAD as is:

<script LANGUAGE="JavaScript">
<!--//
function NewWindow(pagename, pwidth, pheight) {
if (!pwidth) {
pwidth = 600
}
if (!pheight) {
pheight = 480
}
msgWindow=window.open(pagename,"quality","toolbar= no,width=" + pwidth
+ ",height=" + pheight +
",directories=no,status=no,scrollbars=yes,resizabl e=no,menubar=no");
}
//-->
</script>

_____________________________

Please let me know what I have done wrong.
David


Jul 21 '05 #5
Your best bet is probably viewing the source when the page loads this will
give you a better idea of whats wrong, maybe its the case of something in
the statement. Viewing what the browser returns though would be your best
bet
"David" <da***@scene-double.co.uk> wrote in message
news:c1**************************@posting.google.c om...
Hi,

I have text link on each record displayed. This needs to open a new
small window for entering some data, I cannot seem to fix it ?

Hyperlink Code as is:

.... RS("Manual") & "</td><td><a
href=javascript:onclick=NewWindow('JobSerial.asp?J obNumber=" &
RS("JobNumber") & "', 700, 600)>Create JobSheet</a></TD></TR>"

Javascript function in HEAD as is:

<script LANGUAGE="JavaScript">
<!--//
function NewWindow(pagename, pwidth, pheight) {
if (!pwidth) {
pwidth = 600
}
if (!pheight) {
pheight = 480
}
msgWindow=window.open(pagename,"quality","toolbar= no,width=" + pwidth
+ ",height=" + pheight +
",directories=no,status=no,scrollbars=yes,resizabl e=no,menubar=no");
}
//-->
</script>

_____________________________

Please let me know what I have done wrong.
David

Jul 21 '05 #6
da***@scene-double.co.uk (David) wrote in message news:<c1**************************@posting.google. com>...
Hi,

I have text link on each record displayed. This needs to open a new
small window for entering some data, I cannot seem to fix it ?

Hyperlink Code as is:

.... RS("Manual") & "</td><td><a
href=javascript:onclick=NewWindow('JobSerial.asp?J obNumber=" &
RS("JobNumber") & "', 700, 600)>Create JobSheet</a></TD></TR>"


You've left off the quotes around the href, so the ' and the
spaces in the javascript are confusing the browser.

Try the following:

.... RS("Manual") & "</td><td><a
href=""JobSerial.asp?JobNumber=" & RS("JobNumber") & """ target=""_blank""
onclick=""return NewWindow('JobSerial.asp?JobNumber=" &
RS("JobNumber") & "', 700, 600)"">Create JobSheet</a></TD></TR>"

<script type="text\javascript">
function NewWindow(pagename, pwidth, pheight) {
if (!pwidth) {
pwidth = 600
}
if (!pheight) {
pheight = 480
}
msgWindow = window.open(pagename,"quality","toolbar=no,width=" + pwidth
+ ",height=" + pheight +
",directories=no,status=no,scrollbars=yes,resizabl e=no,menubar=no");
}
return !msgWindow;
</script>

Note the changes to the javascript so that it returns whether the window
actually got created or not.

However, this is all clientside stuff and not ASP :)
Jul 21 '05 #7

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

Similar topics

7
by: Randell D. | last post by:
Folks, I am working on a contact db using PHP and MySQL. My results so far outputs a slimed down version of records to the browser. I would like to implement a method whereby the user can...
4
by: Amir Eshterayeh | last post by:
Dear Friends My asp hyperlink goes to relative address instead of absolute. I like navigate url goes to outsite link like www.asp.net but now, it goes to www.mysite/www.asp.net please help....
3
by: francois | last post by:
hi all, I have hyperlink controld in my aspx webpage. When i click on it it needs to open a new window, then i added the attribute target="_blank" But I would like to also give a size to the...
6
by: sck10 | last post by:
Hello, Can you control the window attributes (toolbar, scrollbars, left and right exc.) when using the hyperlink control as you would when using javascript? For examle, I am using the...
4
by: Satya | last post by:
Hi all, The following code is throwing a run time error "The server tag is not well formed. " <ItemTemplate> <asp:HyperLink Runat="server" ID="lnkFile"...
2
by: milbrand | last post by:
I have an ASPX page with a DataList. The ListItems contain a DropDownList and a Hyper Link. The user selects an Item from the Dropdown box and then selects the hyperlink to edit that item. My...
9
by: loga123 | last post by:
I am using asp .net 2.0. I have a hyperlink asp control on my web page page1.aspx. On clicking this hyper;link, I would like to open page2.aspx (which is in the same web application) in a new IE...
1
by: illmagination | last post by:
Hi, I need to display a small pop up message warning the user is leaving the website. At the same time I need to also keep track of who is leaving the website. My problem is that I can't user...
7
by: ashtek | last post by:
I have an <ASP:HYPERLINKon a datagrid (templatecolumn) and I need to open a new window with no toolbar and specific height & width onclick of the link. I also want to pass the PK to this new...
2
by: mdock | last post by:
Hello, I have a javascript grid on my ASP page which displays information about the history of specific units produced in our manufacturing facility. One of the results is the order number on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.