NamePros.Com (http://www.namepros.com/)
-   Programming (http://www.namepros.com/programming/)
-   -   Javascript problems need help please (http://www.namepros.com/programming/15833-javascript-problems-need-help-please.html)

Matrixs 12-16-2003 06:26 AM

Javascript problems need help please
 
Good evening all

due to this javascript book things are not working going by the book and it's not happing, when you go to click on the link a new window come in bit like a popup but in a small window i go to click on the link it dont come up in my browser whats happing here can some help fix the problem for us.

<HTML>
<HEAD>
<FORM>
<A HREF="http://WWW.coolconnections.com.au/cgi-bin/">Login<A/>
<SCRIPT LANGUAGE="jAVAscript" Type"text"/javascript">
<!--function Submitpassword(frm)
{
//
// Get the value entered into the text box
//
var password = frm.pw.value
// Con it to lowercase
//
//
password = password.tolowercase()
//
// Add the.htm extension
//
var loc = password + ".htm
//
// Make sure ther user entered something
//
if (password != "")
{
// If so, send the Browser there
//
opener.location.href = loc
}
//
// close this window
//
window.close()
}
//-->
<SCRIPT>
<TITLE>Username & Password is Required</TITLE>

Mp)Tarh 12-16-2003 03:06 PM

There are several things wrong with your code. I won't go into detail, just replace the following:

Quote:
<SCRIPT LANGUAGE="jAVAscript" Type"text"/javascript">

This should be:
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">

Quote:
<!--function Submitpassword(frm)

This should be two lines:
<!--
function submitpassword(frm)


Quote:
window.close()
}
//-->
<SCRIPT>

This should be:
window.close()
}
//-->
</SCRIPT>


If there are any more problems, just say so.

Matrixs 12-16-2003 06:34 PM

I fix it up but still not working in my defult browser, the link is there but peeks going to another page when i don't want it too. i want it to put up like a small window. I would like to thank you for helping out

:cool:

<HTML>
<HEAD>
<FORM>
<A HREF="http://WWW.coolconnections.com.au/cgi-bin/">Login<A/>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function submitpassword(frm)
{
//
// Get the value entered into the text box
//
var password = frm.pw.value
// Con it to lowercase
//
//
password = password.tolowercase()
//
// Add the.htm extension
//
var loc = password + ".htm
//
// Make sure ther user entered something
//
if (password != "")
{
// If so, send the Browser there
//
opener.location.href = loc
}
//
// close this window
//
window.close()
}
//-->
</SCRIPT>
<TITLE>Username & Password is Required</TITLE>
<BODY>

</BODY>

</HTML>

Mp)Tarh 12-16-2003 06:45 PM

It seems to me like your <BODY> tags are empty. Can you give me a link to the site with this page so I can check it out?

Matrixs 12-16-2003 08:11 PM

it's not on the web yet still doing drawings for my site (ill11) atm i'm just using notepad and using my defult page 2 veiw the work i have done. for the javascripr dose it need to be on the web site to make it work cant i just browse it before i upload it.

Mp)Tarh 12-17-2003 05:41 AM

Quote:
<HTML>
<HEAD>
<FORM>
<A HREF="http://WWW.coolconnections.com.au/cgi-bin/">Login<A/>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function submitpassword(frm)
{
//
// Get the value entered into the text box
//
var password = frm.pw.value
// Con it to lowercase
//
//
password = password.tolowercase()
//
// Add the.htm extension
//
var loc = password + ".htm
//
// Make sure ther user entered something
//
if (password != "")
{
// If so, send the Browser there
//
opener.location.href = loc
}
//
// close this window
//
window.close()
}
//-->
</SCRIPT>
<TITLE>Username & Password is Required</TITLE>
<BODY>

</BODY>

</HTML>



Try this:

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function submitpassword()
{
var password = ussub.pw.value;
password = password.tolowercase()
var loc = password + ".htm";
if (password != "")
{
opener.location.replace(loc);
}
window.close();
}
//-->
</SCRIPT>
<TITLE>Username & Password is Required</TITLE>
</HEAD>
<BODY>
<P ALIGN="center"><FORM NAME="ussub" ACTION="javascript:submitpassword();" METHOD="POST"><B>Username:</B> <INPUT TYPE="password" NAME="pw"> <INPUT TYPE="submit" VALUE="Login"></FORM>
</P>
</BODY>

</HTML>

Matrixs 12-17-2003 11:16 PM

Ok its there but whats happen to my login link and my pop window thats not there.

Mp)Tarh 12-18-2003 04:23 AM

That code I gave you is for the popup window. You should save that code as "passpop.htm". The code for the normal window would be something like:

<HTML>
<HEAD>
<TITLE>Username & Password Required</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
window.open("passpop.htm","mywindow","resizable");
//-->
</SCRIPT>
The username and password window has been opened. If you cannot see it, you will need to update your web browser.
</BODY>
</HTML>

Matrixs 12-18-2003 04:50 PM

How do i update my browser the popup works but way to big is there anyway i can make it smaller. thanks for helping out.

Mp)Tarh 12-19-2003 04:14 AM

<HTML>
<HEAD>
<TITLE>Username & Password Required</TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
window.open("passpop.htm","mywindow","resizable,width=200,height=250");
//-->
</SCRIPT>
The username and password window has been opened. If you cannot see it, you will need to update your web browser.
</BODY>
</HTML>


You can change the width= and height= to your liking. It measures in pixels.


All times are GMT -7. The time now is 12:24 AM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0