By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,490 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

Re Posted in this Forum!

P: 2
Hi am wondering if u can give me a little help with some code. Im a little new to JS so please bare with me

Im creating a login code for our clients to visit a section on our website that is personnal to them. I wanted to stay away from the php side for this website.

The section does not need to be very secure, but the code i have at the moment allows the users to log in but it does not open a new browser window, it opens the page in the current browser window which obviously shows the URL in the search bar! I want to avoid showing anyone the URL. So i thought about the window.open command. Having a new window pop up will allow me to show the page with no Header search abr or anything i prosume? If so how do i implement this into my code?

I have attached the section of code im using as the login button.

if(imgSubmit == ""){
document.write('<input type="button" value="Logon" name="Logon" onclick="login(username.value,password.value, window.open)">');
} else {
document.write('<input type="image" src="'+imgSubmit+'" name="Logon" onclick="login(username.value,password.value)">');
}

This is my code for the login button used in JS. I just want to know where to put the window.open line of code. I think its within the onclick line but im not sure!

Any help would be much appreciated

Cheers.
Oct 6 '06 #1
Share this Question
Share on Google+
2 Replies


10K+
P: 13,264
Hi am wondering if u can give me a little help with some code. Im a little new to JS so please bare with me

Im creating a login code for our clients to visit a section on our website that is personnal to them. I wanted to stay away from the php side for this website.

The section does not need to be very secure, but the code i have at the moment allows the users to log in but it does not open a new browser window, it opens the page in the current browser window which obviously shows the URL in the search bar! I want to avoid showing anyone the URL. So i thought about the window.open command. Having a new window pop up will allow me to show the page with no Header search abr or anything i prosume? If so how do i implement this into my code?

I have attached the section of code im using as the login button.

if(imgSubmit == ""){
document.write('<input type="button" value="Logon" name="Logon" onclick="login(username.value,password.value, window.open)">');
} else {
document.write('<input type="image" src="'+imgSubmit+'" name="Logon" onclick="login(username.value,password.value)">');
}

This is my code for the login button used in JS. I just want to know where to put the window.open line of code. I think its within the onclick line but im not sure!

Any help would be much appreciated

Cheers.
Now that topic will catch quite a lot of eyes!
Oct 6 '06 #2

P: 12
yeah... you could do this, but you will have to deal with popup blockers:

document.write('<input type="button" value="Logon" name="Logon" onclick="login(username.value,password.value);wind ow.open(\'Sample.htm\',null,\'[parameters]\');">');

hope this helps.
Oct 9 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.