Hi,
I've got a link nested inside a form which, when clicked, should open a new window. Whilst it's doing this it also opens the page in the existing parent window as well.
I didn't write the code however, and it worked when not placed in a form. Is the onClick event of the form getting confused with the onclick event of the window?
Heres the header code: - <script language="javascript" type="text/javascript">
-
<!--
-
/****************************************************
-
Author: Eric King
-
Url: http://redrival.com/eak/index.shtml
-
This script is free to use as long as this info is left in
-
Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
-
****************************************************/
-
var win=null;
-
function NewWindow(mypage,myname,w,h,scroll,pos){
-
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*
-
-
((screen.height-h)-75)):100;}
-
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
-
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
-
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no
-
-
,toolbar=no,resizable=no';
-
win=window.open(mypage,myname,settings);}
-
// -->
-
</script>
And the link code for the new window: - <a href="http://marlin/engeastl/scripts/RepairWorkshops/AddNew2.cfm"
-
-
onclick="NewWindow(this.href,'UserAccess','720','340','yes','center');return false" onfocus="this.blur()" class="recordno" style="font-size:
-
-
1.1em;">Add a New Site</a>
And the onClick event of the form in which the link is nested: - <form action="Devaction_add.cfm" method="post" name="form" onKeyUp="highlight(event)" onClick="highlight(event)"
-
-
onsubmit="return formCheck(this);">
Can anyone help?
Thanks
Neil
3 1891
What does highlight() do?
It's a javascript function that highlights a field when the cursor enters it, so the user knows what bit they are filling out.
Perhaps you want to prevent that from firing when the link is clicked.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Mike |
last post by:
In my previous post, I wrote:
> ...
> GOAL: (very simple) Provide a hyperlink which, when clicked,
> calls a javascript function which opens a new URL.
> ...
> PROBLEM: The following code...
|
by: Nick72 |
last post by:
Hi,
I've been reading through tons of posts regarding the problems people
have encountered with getting javascript functions to trigger when
called from onclick events... But so far, I haven't...
|
by: Eric-Sebastien Lachance |
last post by:
Hey there,
I decided to just create a 100% height and width div that filled the
space over a background header image, and add an onclick event to
redirect to the my index... Doesn't seem to work...
|
by: Michel |
last post by:
Hi Group of helpers,
Following snippet of code:
<HTML>
<HEAD>
<script>
function color(value)
{
alert(value);
|
by: dan_williams |
last post by:
I have the following test web page:-
<html>
<head><title>Test</title>
<script language="Javascript">
<!--
function fnTR() {
alert("TR");
}
|
by: joaotsetsemoita |
last post by:
Hello everyone,
I'm having troubles assigning an onclick event to a cell. Im trying
something like
cursorPoint.cells.style.cursor = "hand";
cursorPoint.cells.width = "20";...
|
by: Dan Rumney |
last post by:
All,
I have a web page (copied below) with 3 images on it of fixed
dimensions.
Each image has a map associated with it
In the maps, there are a number of areas with an onClick handler...
|
by: brucedodds |
last post by:
I have an Access 2003 form bound to a SQL Server table via ODBC.
Often clicking a button on the form has the effect of requerying the
form rather than firing the OnClick event. Does anyone have...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |