473,395 Members | 1,956 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,395 software developers and data experts.

Window.Open () not working

Hello,

Within a form I created I have placed links that users can click on to
view information. I am trying to write a javascript code so it opens in
a sized window but I can't seem to figure this out. So far I have come
up with the following:

<script language="JavaScript" type="text/javascript">
var WindowObjectReference; // global variable

function openRequestedPopup()
{
WindowObjectReference =
window.open("http://egsrosintra1/egs%20intranet/ACPCodes.html",
"ACP Codes",
"width=420,height=230,resizable,scrollbars=yes,sta tus=1");
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>BPCS and Logpro User Authority Form</title>
<style type="text/css">
And in the text code: <p><a
href="javascript:OpenRequestedPopup('http://egsrosintra1/egs%20intranet/ACPCodes.html');">ACP
- Accounts Payable</a><br />
Any ideas as to why it is not working correctly? And when I need to add
the additional criteria to open the other links where would I insert
that code?

Thanks in advanced,
Justine

Apr 6 '06 #1
5 2239
Look at your function... case sensitive + argument list is completly
not the same...

Apr 6 '06 #2
I still can't seem to get it to work. I looked at the function and
noticed in my href= that the "O" should have not been capitalized. Then
I changed the rest to:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<<<-------------SCRIPT STARTS HERE-------------------------->>>>
<script language="JavaScript" type="text/javascript">
var WindowObjectReference; // global variable
function openRequestedPopup()
{
WindowObjectReference = window.open("", "", "width=420,height=230");
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>BPCS and Logpro User Authority Form</title>
<style type="text/css">
<!--
..style1 {
color: #666666;
font-style: italic;
}
..style3 {
font-size: 18px;
color: #000066;
}
#Layer1 {
position:absolute;
left:570px;
top:491px;
width:262px;
height:322px;
z-index:1;
}
..style8 {font-size: 18px; color: #FF0000; }
-->
</style>
</head>

<body>
<div id="Layer1" style="position: absolute; left: 540px; top: 476px;
width:235px">
<p align="center"><u><font color="#808080" size="4"><b>Transaction
Codes:</b></font></u></p>

<<<<-----------------------------------ANCHOR HREF TAG IS
BELOW-------------------->>>>:
<p><a
href="javascript:openRequestedPopup("http://egsrosintra1/egs%20intranet/ACPCodes.html",
"ACP Codes");">ACP - Accounts Payable</a><br />
<a href="ACRCodes.html" target="_blank">ACR - Accounts
Receiveable</a><br />
<a href="BILCodes.html" target="_blank">BIL - Billing</a><br />
<a href="BOMCodes.html" target="_blank">BOM - Bill of Material</a><br
/>
<a href="CAPCodes.html" target="_blank">CAP - Capacity
Planning</a><br />
<a href="CSTCodes.html" target="_blank">CST - Cost</a><br />
<a href="DRPCodes.html" target="_blank">DRP - Distribution Resource
Planning</a><br />
<a href="FORCodes.html" target="_blank">FOR - Forecasting</a><br />
<a href="INVCodes.html" target="_blank">INV - Inventory
Management</a><br />
<a href="JITCodes.html" target="_blank">JIT - Just in Time /
Repetitive Mgmt.</a><br />
MDM - Manufacturing Data
</p>
</div>
<h1 align="center" class="style1">BPCS and LogPro User Authority
Form</h1>
<form action="SecurityReqThanks.asp" method="post"
name="SecurityRequest" target="_blank" id="SecurityRequest">
<p class="style3">User Information -All fields are required: </p>
<p>
<label>First Name:
<input name="UserFirstName" type="text" id="UserFirstName"
size="25" maxlength="15" />
</label>
<label>Last Name:
<input name="UserLastName" type="text" id="UserLastName" size="22"
maxlength="30" />
</label>
<br />
<label>ID Number:
<input name="UserID" type="text" id="UserID" size="24"
maxlength="10" />
</label>
<label>Site:
<select name="UserSite" id="UserSite">
<option value="Select" selected="selected">Select</option>
<option value="Amiens, France">Amiens, France</option>
<option value="Atizapan, Mexico">Atizapan, Mexico</option>
<option value="Celina, Tennessee">Celina, Tennessee</option>
<option value="Columbus, Nebraska">Columbus, Nebraska</option>
<option value="East Granby, Connecticut">East Granby,
Connecticut</option>
<option value="Elmira, Canada">Elmira, Canada</option>
<option value="Fullerton, California">Fullerton,
California</option>
</select>
</label>
<br />
<label>Data Base:
<select name="DataBase" id="DataBase">
<option value="Select" selected="selected">Select</option>
<option value="ECM / Sola / Heat">ECM / Sola / Heat</option>
<option value="EZ Heat Canada">EZ Heat Canada</option>
<option value="EZ Heat U.S.">EZ Heat U.S.</option>
</select>
</label>
</p>
<p>
<label><span class="style3">Copy Authority Information:</span><br
/>
First Name:
<input name="CopyFirstName" type="text" id="CopyFirstName"
maxlength="15" />
Last Name:
<input name="CopyLastName" type="text" id="CopyLastName"
maxlength="30" />
<br />
ID Number:
<input name="CopyAuthID" type="text" id="CopyAuthID" size="23"
maxlength="10" />
</label>
</p>
<p class="style3">Authority Exceptions</p>
<ol>
<li><a href="#TransactionCodes">Transaction Codes</li></a>
<li><a href="#WarehouseCodes">Warehouse Codes</li></a>
<li><a href="#TransactionEffectCodes">Transaction Effect
Codes</li></a>
<li><a href="#LogProDeptAuthority">LogPro Department Authority
</li></a>
<li><a href="#UserMenu">User Menus</li></a>
</ol>

<p class="style8"><u>Please separate each code to be
&quot;removed&quot; or &quot;added&quot; with a comma:</u></p>
<label> <span class="style3"><a id="TransactionCodes"
name="TransactionCodes">1. Transaction Codes </a></span><br />
<br />
Remove:<br />
<textarea name="TransactionRemove" cols="60" rows="5"
id="TransactionRemove"></textarea>
</label>
<p>
<label>Add: <br />
<textarea name="TransactionAdd" cols="60" rows="5"
id="TransactionAdd"></textarea>
</label>
</p>
<p class="style3"><a id="WarehouseCodes" name="WarehouseCodes">2.
Warehouse Codes</a> </p>
<p>
<label>Remove: <br />
<textarea name="WarehouseRemove" cols="60" rows="2"
id="WarehouseRemove"></textarea>
</label>
</p>
<p>
<label>Add: <br />
<textarea name="WarehouseAdd" cols="60" rows="2"
id="WarehouseAdd"></textarea>
</label>
</p>
<p class="style3"><a id="TransactionEffectCodes"
name="TransactionEffectCodes">3. Transaction Effect Codes (for INV500
and PUR550)</a></p>
<p>
<label>Remove:<br />
<textarea name="TransactionEffectRemove" cols="60" rows="2"
id="TransactionEffectRemove"></textarea>
</label>
</p>
<p>
<label>Add:<br />
<textarea name="TransactionEffectAdd" cols="60" rows="2"
id="TransactionEffectAdd"></textarea>
</label>
</p>
<p class="style3"><a id="LogProDeptAuthority"
name="LogProDeptAuthority">4. LogPro Department Authority</a></p>
<p>
<label>Remove:<br />
<textarea name="LogProRemove" cols="60" rows="2"
id="LogProRemove"></textarea>
</label>
</p>
<p>
<label>Add:<br />
<textarea name="LogProAdd" cols="60" rows="2"
id="LogProAdd"></textarea>
</label>
</p>
<p class="style3"><a id="UserMenu" name="UserMenu">5. User
Menus</a></p>
<p>
<label>Remove:<br />
<textarea name="UserMenuRemove" cols="60" rows="2"
id="UserMenuRemove"></textarea>
</label>
</p>
<p>
<label>Add:<br />
<textarea name="UserMenuAdd" cols="60" rows="2"
id="UserMenuAdd"></textarea>
</label>
</p>
<p>
<label><span class="style3">Comments:</span><br />
<textarea name="Comments" cols="60" rows="5"
id="Comments"></textarea>
</label>
</p>
<p>
<label>Authorized Submitter:
<input name="AuthorizedSubmitter" type="text"
id="AuthorizedSubmitter" size="40" maxlength="40" />
</label>
<input name="SecurityDate" type="hidden" id="SecurityDate" />
04/04/2006</p>
<p>
<input type="submit" name="Submit" value="Submit" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;
<input type="reset" name="Submit2" value="Reset" />
</p>
<p>&nbsp;</p>
</form>
</body>
</html>
Any help or refereneces are appreciated

Thanks once again,
Justine

Apr 6 '06 #3
NEVER post entirely code like that... it is SO useless

I said check your arguments :

function openRequestedPopup() <---- no argument here
and
javascript:openRequestedPopup("http://egsrosintra1/egs%20intranet/ACPCodes.html",
"ACP Codes"); <---- arguments here

change your function add 2 arguments: a1, a2, and do something like
that
WindowObjectReference = window.open(a1, a2, "width=420,height=230");

The a2 is a title of the page and i don't think spaces are allowed

Apr 6 '06 #4
GRenard said the following on 4/6/2006 3:58 PM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers. <URL: http://www.safalra.com/special/googlegroupsreply/ >
NEVER post entirely code like that... it is SO useless

I said check your arguments :

function openRequestedPopup() <---- no argument here
and
javascript:openRequestedPopup("http://egsrosintra1/egs%20intranet/ACPCodes.html",
"ACP Codes"); <---- arguments here
The original code had javascript:OpenRequestedPopup with a capital O,
the function name had a lowercase o.
change your function add 2 arguments: a1, a2, and do something like
that
WindowObjectReference = window.open(a1, a2, "width=420,height=230");

The a2 is a title of the page and i don't think spaces are allowed


They aren't in IE.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 6 '06 #5
JN*****@gmail.com wrote :
Hello,

Within a form I created I have placed links that users can click on to
view information. I am trying to write a javascript code so it opens in
a sized window but I can't seem to figure this out. So far I have come
up with the following:

<script language="JavaScript" type="text/javascript">
Language is deprecated; just use type. Idem est:

<script type="text/javascript">

http://www.w3.org/TR/html401/interac...#adef-language
var WindowObjectReference; // global variable

function openRequestedPopup()
{
WindowObjectReference =
window.open("http://egsrosintra1/egs%20intranet/ACPCodes.html",
"ACP Codes",

"strWindowName
This is the string that just names the new window. Such string can
be used to be the target of links and forms when the target attribute of
an <a> element or of a <form> is specified. This [Window name] string
parameter *_should not contain any blank space_*."
http://developer.mozilla.org/en/docs...and_parameters

Idem est:
"ACPCodes" or "ACP_Codes"
"width=420,height=230,resizable,scrollbars=yes,sta tus=1");
It's better to define the function like this:

<script type="text/javascript">
var WindowObjectReference;
function openRequestedPopup(strUrl, strWindowName)
{
if(!WindowObjectReference || WindowObjectReference.closed)
{
WindowObjectReference =
window.open(strUrl, strWindowName,
"width=420,height=230,location,resizable,scrollbar s,status");
}
else
{
WindowObjectReference.focus();
};
}
</script>

(...)

and then to structure the call like this:

<p><a href="http://egsrosintra1/egs%20intranet/ACPCodes.html"
target="ACPCodes"
onclick="openRequestedPopup(this.href, this.target); return false;"
title="Clicking this link will create a new window or will bring up back
on top an already opened secondary window">Show the ACP -- Accounts
Payable</a></p>

In the openRequestedWindow, I added location because its presence will
be forced in IE 7.

The above code could be furthermore improved if we knew for what this
would be used.
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>BPCS and Logpro User Authority Form</title>
<style type="text/css">
And in the text code: <p><a
href="javascript:OpenRequestedPopup('http://egsrosintra1/egs%20intranet/ACPCodes.html');">ACP
- Accounts Payable</a><br />


Never use "javascript:" pseudo-protocol, even if your webpage was to go
on an intranet. "javascript:" pseudo-protocol will break in many
situations and contexts, even on an intranet. An href attribute value
should *_always_* have a real link.

http://developer.mozilla.org/en/docs.....29.22_....3E

http://www.panix.com/~aahz/javascript.html#remove

http://jibbering.com/faq/#FAQ4_24

Gérard
--
remove blah to email me
Apr 7 '06 #6

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

Similar topics

2
by: venkatesh | last post by:
Hi Members, I have used the below mentioned code to open a html page in a new browser. The window size is 200 x 300. In that browser, I've given code to open another browser of the same size....
2
by: Mountain Man | last post by:
Hi, I'm trying to use window.open from inside a user defined function, and it's not working. A code example is shown below. Thanks for any help you can give. Mountain Man ============ ...
2
by: carlor | last post by:
Hi there, I have a form that contains a link button. When the user clicks the link button I need to enable a couple of other buttons on the page and open a new browser window giving it focus...
4
by: Csaba Gabor | last post by:
Up until a few weeks ago, javascript code like window.open("http://mydomain.com", "windowName"); would always bring my new or reused window to the top, with focus. Lately, Firefox (Deer park...
2
by: DOM_scripter | last post by:
Hi, I want to set a picture on the fly. For this I have a html file with only an <img> tag - kind of a placholder. So I do myWindow=window.open("data/myFile.html"). Then I set the src attribute of...
6
by: Jeff | last post by:
hey guys, this may not be the right place, but i wanted to give it a shot. i have an if statement, based on the data of a mssql db. if the if is .eof do nothing else
1
by: shotokan99 | last post by:
i have this function: function doit(){ if (dow.cpmake.selectedIndex==1 && dow.cpmodel.selectedIndex==0){ window.open('http://www.mysite.com/mycab.cab'); } } using ie this using will...
5
by: ting ting | last post by:
I am working on a ASP.net 2.0 version and I want to click a button to open a window. I was using window.open to write at vb side. Response.Write("<Script...
16
by: CreativeMind | last post by:
hi, i have a page calendar.aspx which returns selected date i.e window.returnValue=selectedDate; window.close(); it works fine with IE but not for Firefox. i tried...
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: 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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.