473,786 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Javascript login

Hello, I am a computer science major. I have had HTML and Java, but not any
JavaScript. I know they are similar, but there seem to be a lot of functions
and methods I am not familiar with. Plus I don't have a good understanding
of what Java can do within the web environment. (My Java classes
concentrated on console based applications.)

What I want is a simple Java Login box for "Apartment Number" that takes
that value and assigns it to a variable, such as "apartment" . I would like
to take the value of that variable, for example, 1555-7 and have the
computer load the webpage "1555-7.html"; preferrably within a frame called
Body. I would also like to do this without a popup, but an actual text box
within the webpage. Any help would be appreciate. I have seen various
methods of loading a new webpage, but don't which one to use. I have also
looked through the free scripts, and none of them seem to work for what I
want. They are either popups, or do too many complicated encryption
functions. Any help would be appreciated. I think I have a good idea on the
basic input to variable aspect. But don't have a clue as to how to load a
webpage using JavaScript.

P.S. What is the best, most complete source for JavaScript knowledge? (book
or website) Something that covers all that JavaScript can do.
Jul 23 '05
12 2445
First let me thank you for your help. However, I never said it was "my"
code. Secondly, Javascript is something I am not familiar with, which I
stated. (Other than it's similarity to Java) Third, this ain't Fort Knox. I
am not even thinking of security right now.

However I must say that your code is the most efficient, as I have seen some
truly over the top examples, to do simple things.
"Grant Wagner" <gw*****@agrico reunited.com> wrote in message
news:Pe******** ******@news2.mt s.net...
"GreenBayFa n" <wd*@panola.com > wrote in message

news:10******** *****@corp.supe rnews.com...

Your code was such a horrible mess I completely re-wrote it:

<form action="" method="GET" onsubmit="retur n go(this);">
<p>Enter your apartment number: <input type="text" name="Apartment "></p>
<p><input type="submit" value="Log In" name="Submit"></p>
</form>
<script type="text/javascript">
function go(f) {
var a = f.elements['Apartment'];
switch(a) {
case '1555-5':
case '1555-6':
case '1555-7':
f.target = a + '.html';
return true;
break;
}
return false;
}
</script>

It is trivially easy to get around by looking at the source code (and
no, you can't hide the JavaScript source from the person). And it
provides no way to stop the user from simply entering another apartment
number, or for that matter, typing
http://yourserver/{someapartment# }.html into their Web browser's address
bar.

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq

Jul 23 '05 #11
On second though, your code isn't working. Think I will stick with one of
the free scripts I got off the internet. At least it worked.

Thanks anyway.

"GreenBayFa n" <wd*@panola.com > wrote in message
news:10******** *****@corp.supe rnews.com...
First let me thank you for your help. However, I never said it was "my"
code. Secondly, Javascript is something I am not familiar with, which I
stated. (Other than it's similarity to Java) Third, this ain't Fort Knox.
I am not even thinking of security right now.

However I must say that your code is the most efficient, as I have seen
some truly over the top examples, to do simple things.
"Grant Wagner" <gw*****@agrico reunited.com> wrote in message
news:Pe******** ******@news2.mt s.net...
"GreenBayFa n" <wd*@panola.com > wrote in message

news:10******** *****@corp.supe rnews.com...

Your code was such a horrible mess I completely re-wrote it:

<form action="" method="GET" onsubmit="retur n go(this);">
<p>Enter your apartment number: <input type="text" name="Apartment "></p>
<p><input type="submit" value="Log In" name="Submit"></p>
</form>
<script type="text/javascript">
function go(f) {
var a = f.elements['Apartment'];
switch(a) {
case '1555-5':
case '1555-6':
case '1555-7':
f.target = a + '.html';
return true;
break;
}
return false;
}
</script>

It is trivially easy to get around by looking at the source code (and
no, you can't hide the JavaScript source from the person). And it
provides no way to stop the user from simply entering another apartment
number, or for that matter, typing
http://yourserver/{someapartment# }.html into their Web browser's address
bar.

--
Grant Wagner <gw*****@agrico reunited.com>
comp.lang.javas cript FAQ - http://jibbering.com/faq


Jul 23 '05 #12
GreenBayFan wrote:

P.S. What is the best, most complete source for JavaScript knowledge? (book or website) Something that covers all that JavaScript can do.


David Flanagan's "Javascript : The Definitive Guide". You can even read
it online for free, with a 14-day trial subscription to
safari.oreilly. com (lot's of other online books, for as little as $10 a
month)

Jul 23 '05 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2332
by: mouac01 | last post by:
I'm new to PHP/Javascript. I have a simple form I want to validate the fields with javascript and then run the PHP script. All the scripts are in one page. I want PHP to control where the next page is. It works fine without the javascript but when I add the javascript the page doesn't do anything besides the validation. Thanks for your help... Chong ----login.html-------------------------------- <?php ob_start();
0
2637
by: yinxi | last post by:
I' m trying to integrate an application using a web-based interface to our firm application. it has required login information at the beginning. on the login page it has one field to give in the password, and one button to submit the input. It is a javascript form in background as i check the source code. Is it possible to simulate it with a HTTP client in Java with POST? Or is there any other trick? cheers, XP
1
6465
by: saiyen | last post by:
Hey all, ive been banging my head agains the wall for a few days now, and finally decided to ask for help. i have a document that writes the header with all the javascript in it, then modifyes a <div> tag with a button. the button has an onClick event that is supposed to call a javascript function in the header. The whole application works wonderfully in Firefox, however it seems as if IE cannot/willnot call the function. if i put an alert in...
1
1180
by: drewhiggins | last post by:
I've got a JavaScript login form all working. Now what I would like to add is a checkbox where I tick it and it remembers me for next time - I realise it requires Cookie integration, but how??? Wouldn't I need PHP? I am using IE6 and Firefox on WinXP, and my HTML coder is FrontPage 2003. Thanks a lot if yo can solve it.
1
5127
by: jianxin9 | last post by:
Hi, I have an ajax powered tabs box that has a javascript drop-down search menu in the first tab. When I click on another tab, and go back to the first tab I have to refresh the page to get the information to load. Any suggestions on how I might get around that. The articles tab is the tab where the javascript won't load. Thanks so much for any help you might be able to provide: This is what the tabs code looks like: <ul...
3
2713
by: divina11 | last post by:
I'm writting a login script using JavaScript, can someone help with the parts I've commented? Thank you <HTML><HEAD> <TITLE>Login Program</TITLE> </HEAD> <SCRIPT> function validate() {
16
2031
by: srinathpandit | last post by:
Hi, The below javascript is not working in the firefox, Please help me.. <script> function Login(){ var done=0; var username=document.login.username.value; username=username.toLowerCase(); var password=document.login.password.value;
3
1957
by: VLJones68 | last post by:
I have a website which contains the root directory, a MemberPages directory and a PublicPages directory. Default.aspx resides in the root directory and includes a javascript login. Upon clicking the Login button the user should be directed to a page within the MemberPages directory. I had this working, however added a new user last night and since then no logins are working. We are in progress on building a fully secure site with SQL Db...
1
14328
by: sadanandsuvarna | last post by:
Hi, I hv created following script for rediffmail login, i've saved login name and password and has saved it with .html extension so that when i click on the file it wud directly take me to inbox screen, everything works fine, but it does not submit after displaying username and passwd. It shd directly submit after i run .html file, which is not happening, (put ur username wherey i hv mention in capital letters: HERE I HAVE FED MY USERNAME and...
0
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.