473,473 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Question on input box

24 New Member
How would i make this work without using the input button. to make it so they can hit enter and it will check the password??

Expand|Select|Wrap|Line Numbers
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  3.     <html>
  4.         <head>
  5.             <title>Coming...</title>
  6.                 <script type="text/javascript">
  7.         function CheckMe()
  8.         {
  9.         var strPassword = document.getElementById("strPassword").value
  10.         if (strPassword == "New England Clam Chowder")
  11.             {
  12.                 window.location="http://google.com"
  13.             }
  14.             else
  15.             {
  16.                 alert("No Way Jose")
  17.             }
  18.         }
  19.  
  20.  
  21.  
  22.  
  23.         </script>
  24.         </head>
  25.             <body>
  26.         The Password Is: New England Clam Chowder
  27.                   <form>
  28.             <input type="password" id="strPassword" size="25" />
  29.             <br />
  30.             <input type="button" onclick="CheckMe()" size="25" value="Submit" />
  31.         </form>
  32.             </body>
  33. </html> 
Mar 26 '07 #1
3 1145
iam_clint
1,208 Recognized Expert Top Contributor
a submit button will capture enter




you can also capture the enter key's keystroke
Mar 26 '07 #2
codeex
24 New Member
is there a way to hide the submit button, and also when i hit enter it wont work.
Mar 26 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
A style setting of "display:none" or "visibility:hidden" will hide the submit button.

The key code for enter is 13. Check for that onkeyup. See this link.
Mar 27 '07 #4

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

Similar topics

0
by: John Wilson | last post by:
Hello, I have the following code which populates as table data from a SQL Server 2000 stored proc (RSByDemoID2). Below that is the view and stored procedure which takes @DemoID as input to match...
7
by: Kevin Stern | last post by:
Hi All, Here is a program I wrote and compiled using g++ #include <iostream> int main() { char a; std::cin.get(a); std::cout << a; std::cin.ignore(100, '\n');
9
by: LNM | last post by:
I am trying to create a survey type form where multiple choice answers are selected (radios) and I am using an onclick event to update a text box with 'correct', etc. I am using the...
0
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
13
by: Eric_Dexter | last post by:
All I am after realy is to change this reline = re.line.split('instr', '/d$') into something that grabs any line with instr in it take all the numbers and then grab any comment that may or may...
2
by: gdarian216 | last post by:
the object of the project was to create a program that inputs multiple lines of integers and outputs them in an HTML table. The negative numbers should be red. The numbers should be printed 3 in a...
4
by: Engineerik | last post by:
I am trying to create a socket server which will listen for connections from multiple clients and call subroutines in a Fortran DLL and pass the results back to the client. The asynchronous socket...
5
by: theflyingminstrel | last post by:
Hi I have a question, it's probably very basic but I'm still learning the Javascript basics. The following form outputs a string change (from "input" to "text" box ). When the word "test" is...
2
by: robtyketto | last post by:
Greetings, Within my jsp I have HTML code (see below) which accepts input, one of these fields sequence unlike the others is an Integer. <FORM ACTION="wk465682AddFAQ.jsp" METHOD="POST"> Id:...
2
by: subramanian100in | last post by:
Consider the following program named as x.c #include <stdlib.h> #include <stdio.h> int main(void) { unsigned int u; char str;
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.