PDA

View Full Version : Javascript Help Needed.....



Alex
13-06-2010, 06:16 PM
Hey guys and girls....

I need some Javascript assistance as I'm now stuck!

I need to be able to make the login window open in a NEW window!

Here is the current coding :



<form action="http://alexentertainmentplanning.co.uk/clientlogon.asp" method="post">
<table align="center">
<tbody>
<tr>
<td>
Username</td>
<td>
<input name="username" type="text" /></td>
</tr>
<tr>
<td>
Password</td>
<td>
<input name="password" type="password" /></td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<input name="submit" type="submit" value="Log On" /></td>
</tr>
</tbody>
</table>
<br />
<br />
<SCRIPT LANGUAGE='JAVASCRIPT' TYPE='TEXT/JAVASCRIPT'>document.write("<p align=center><a href='javascript:SendPasswordWindow()'>Forgot Your Password?</a></p>")</SCRIPT><NOSCRIPT><a href="http://alexentertainmentplanning.co.uk/sendpassword.asp?typeoflogon=client">Forgot Your Password?</a></NOSCRIPT></form>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">

<!--

function SendPasswordWindow() {

spWindow = window.open('http://alexentertainmentplanning.co.uk/sendpassword.asp?typeoflogon=client','spWindow','w idth=350,height=150,menubar=no,scrollbars=no,resiz able=yes,location=no,directories=no,status=no');

spWindow.focus();

}

// -->

</SCRIPT>


I've tried everything I can think of to make it "pop" open.... but nothing is working! :(

Any clues?????

In the HREF section I have tried adding _Target / _Self / _Blank and nothing changes! So we can count that out! LOL

Jiggles
13-06-2010, 08:07 PM
<!-- TWO STEPS TO INSTALL POPUP WINDOW:

1. Paste the first into the HEAD of your HTML document
2. Use the code to open the popup page on your site -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->




<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,men ubar=0,resizable=0,width=500,height=500,left = 470,top = 200');");
}
// End -->
</script>



<!-- STEP TWO: Use the following link to open the new window -->


<A HREF="javascript:popUp('http://alexentertainmentplanning.co.uk/sendpassword.asp?typeoflogon=client')">Forgot Password?</A>


Try that.

DJ Jules
14-06-2010, 06:32 AM
In the HREF section I have tried adding _Target / _Self / _Blank and nothing changes! So we can count that out! LOL

The syntax is target="_new" or target="_self" or target="_blank", e.g.:

<a href="link.html" target="_new">Link</a>

Hope that helps to some extent. If the code you were using before wasn't working, then you'll probably find that your browser was showing the "NOSCRIPT" section, because the javascript should definitely have worked. *

Julian

* Caveat - I haven't read the code in detail or tried it myself, but in principle it ought to work