473,386 Members | 2,129 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,386 software developers and data experts.

Simple Stuff...for someone..

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
2 1285
r035198x
13,262 8TB
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.
java != javascript. There is a javascript forum on this site where you are likely to get better help than you'll get here.

My bet will be that you put the window.open inside the function login
Oct 6 '06 #2
hey just try this one...

u can just call a java script function while submitting the form as

onclick ="return submitLoginForm();"

u can just include the window.open command as

<script type="text/javascript">
function submitLoginForm()
{
alert(document.forms[0].username.value);
alert(document.forms[0].password.value);
window.open(' @@@',' ',' width=550,height=500 ');
document.forms[0].submit();
return true;
}
}
</script>

@@@ - u can give ur URL there
u can simple get the username and password values by document.forms[0].username.value ,document.forms[0].password.value.
Oct 9 '06 #3

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

Similar topics

1
by: Larry | last post by:
I am a C++/Java programmer trying to get going with some simpe xml transformations at work here. I bought the O'Reilly book Learning xlst for kicks. Someone at work sent me this xml shown below,...
1
by: Howard | last post by:
Hi, I am using a very simple xslt file to get info from an xml document. The problem seems to me to be that the xml doc uses a namespace, and I don't know how to set up my xslt to recognize it...
8
by: Bshealey786 | last post by:
Okay im doing my final project for my first computer science class(its my major, so it will be my first of many), but anyway im a beginner so im not to great with C++ yet. Anyway this is the error...
1
by: George | last post by:
I'm a long time C++/SQL programmer. Know some C# application stuff. Basics of setting up a web server. Basic html and Java. And nothing about ASP.NET
1
by: Rodo | last post by:
Hi all, I'm trying to generate a simple crystal report without a database. Several people mention the use of a dataset. Someone mention in a msdn forum that I could use the SetParameterValue to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.