From: Amateur on
Dear Sirs

I do have a simple “Login” page which is situated in an inline frame of a
main page.
If I try to “Login” with the password – the new page is opening as well in
the inline frame.
I would like that the new page is opening in a new window.
How can I alter my code that this will happen?

This is a part of the code for the Login page:

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<link href="style.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(){
var done=0;
var accountnumber=document.login.accountnumber.value;
accountnumber=accountnumber.toLowerCase();
if (accountnumber="972T854") {
window.location="http://www.??????.com/US/Openingforms/BIE30P.pdf"; done=1; }
if (accountnumber="972S859") {
window.location="http://www.???????.com/US/Openingforms/BIE30.pdf"; done=1; }
if (done==0) { alert("Invalid login! Format= XXXXXXX (align left)"); }
}
// End -->
</SCRIPT>
*
*
<tr>
<td valign="top" width="425" height="41" bgcolor="#C0C0C0">

<p><FORM NAME="login">
<p align="right"><font color="#0033CC" size="2"><b>Enter
password: </b> <INPUT TYPE="text" NAME="accountnumber" value="Password"
class="input2" style="padding-top:3px; font-family:Times New Roman;
font-size:8pt; color:#0000FF" size="24">
<img border="0" src="http://www.??????.com/BIE/images/go.gif"
width="22" height="17" VALUE="Login!" ONCLICK="Login()"></div></div></p></tr>

From: Ronx on
You need to radically rethink that login page.
The script contains the login credentials - if the pdf document contains sensitive information there is NO (that is ZERO) security. Server side code (PHP, ASP, asp.NET) is required for security.

To answer the question, to open a new window with JavaScript you will need to open a pop-up window. This action will be blocked by most modern browsers, as well as most third party pop-up blockers, since the pop-up is opened by a form action, not by clicking on a link.

To replace the entire page, try (not tested)

if (accountnumber="972T854") {
parent.location="http://www.??????.com/US/Openingforms/BIE30P.pdf"; done=1; }
if (accountnumber="972S859") {
parent.location="http://www.???????.com/US/Openingforms/BIE30.pdf"; done=1; }

Finally, no-one will be able to login and get the page anyway -
the script is comparing _lower case_ letters with _upper case_ - a mismatch every time.

accountnumber=accountnumber.toLOWERcase();
if (accountnumber="972 T 854")

(case changes and extra spaces added for clarity)

--
Ron Symonds
Microsoft MVP (Expression Web)
http://www.rxs-enterprises.org/fp/wf-menu.aspx


Amateur formulated on Thursday :
> Dear Sirs

> I do have a simple “Login” page which is
> situated in an inline frame of a main page.
> If I try to “Login” with the password – the new
> page is opening as well in the inline frame.
> I would like that the new page is opening in a
> new window. How can I alter my code that this
> will happen?

> This is a part of the code for the Login page:

> <meta http-equiv="Content-Type"
> content="text/html; charset=windows-1252">

> <link href="style.css" rel="stylesheet"
> type="text/css"> <SCRIPT LANGUAGE="JavaScript">
> <!-- Begin
> function Login(){
> var done=0;
> var
> accountnumber=document.login.accountnumber.value;
> accountnumber=accountnumber.toLowerCase(); if
> (accountnumber="972T854") {
> window.location="http://www.??????.com/US/Openingforms/BIE30P.pdf";
> done=1; } if (accountnumber="972S859") {
> window.location="http://www.???????.com/US/Openingforms/BIE30.pdf";
> done=1; } if (done==0) { alert("Invalid login!
> Format= XXXXXXX (align left)"); } } // End -->
> </SCRIPT>
> *
> *
> <tr>
> <td valign="top" width="425"
> height="41" bgcolor="#C0C0C0">

> <p><FORM NAME="login">
> <p align="right"><font
> color="#0033CC" size="2"><b>Enter password:
> </b> <INPUT TYPE="text" NAME="accountnumber"
> value="Password" class="input2"
> style="padding-top:3px; font-family:Times New
> Roman; font-size:8pt; color:#0000FF"
> size="24"> <img border="0"
> src="http://www.??????.com/BIE/images/go.gif"
> width="22" height="17" VALUE="Login!"
> ONCLICK="Login()"></div></div></p></tr>