473,788 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

single text field, submission with ENTER or TAB

Because this is a form with a single text field, I require submition
when ENTER OR TAB is pressed in the text box). However since their is
only one field I can't use tab. Nor for some reason can I use enter.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>third page</title>
<script type="text/javascript">
<!--
function changeEvent(){
alert("stuff");
document.close( )
}
//-->
</script>
</head>

<body>
<form onsubmit="retur n false">
Enter text to be copied to calling page
<input type="text" onchange="chang eEvent()" value="type something">
</form>
</body>
</html>

Dec 19 '06 #1
3 1852
Rupe wrote on 19 dec 2006 in comp.lang.javas cript:
Because this is a form with a single text field, I require submition
when ENTER OR TAB is pressed in the text box). However since their is
only one field I can't use tab. Nor for some reason can I use enter.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>third page</title>
<script type="text/javascript">
<!--
do not use <!--

function changeEvent(){
alert("stuff");
document.close( )
}
//-->
do not use //-->
</script>
</head>

<body>
<form onsubmit="retur n false">
Logically, my dear Watson, submission is effectively switched off by the
above onsubmit!
Enter text to be copied to calling page
<input type="text" onchange="chang eEvent()" value="type something">
onchange will only fire on blur, I think.
</form>
</body>
</html>
Try:

<form>
<input
onkeydown = 'if (event.keyCode= =9) this.form.submi t();'
type="text" name='what' value="give enter or tab">
</form>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 19 '06 #2
i'm not actually wanting to do a submit as such, i'm only wanting to
update the main page data via opening a second page, placing details in
that second page then returning to the main page.

further, I was trying not to use window.open() rather just change the
location.href value. unfortunately just doing this on returning to the
main page, the second page's details remains in the browser. id running
window.document .title after returning to the main page returns the
title of the second page.

perhaps there a page naviagation tutorial online you recommend. as the
only way seems to be to open a second tab/window and then close it
after. I was just hoping to flick documents within the same tab.

Dec 19 '06 #3
Rupe wrote on 19 dec 2006 in comp.lang.javas cript:
i'm not actually wanting to do a submit as such,
What are you talking about???????

[please always quote on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Dec 19 '06 #4

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

Similar topics

1
7436
by: Newbie | last post by:
OK, this may be impossible since I'm using 3rd party shopping cart ASP software, but I've been able to finagle a lot of other stuff I thought wouldn't work, so here we go: I'm using a form in which users enter numbers to be calculated into a square footage cost. Upon submitting, the results page uses ASP to give the total and the chance to add the new totalled item to the cart or try a new calculation. Part of the cart's software has a...
3
14021
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it dosent meet these requirments an error message will be displayed. I have pasted the code (and highlighted the relevant parts) below in the hope that someone can help me out with this. Ive been trying to suss it out all week & it's driving me nuts!...
3
2864
by: Solution Seeker | last post by:
I want to Store the String value with Single Quotes in the Field of Database where if i try to Store the String value with Single Quotes (as it is) then it is throwing the error as SQL String Truncated. so we need a solution to store and retrieve user Entered value along with single quotes into the Database. i am using the String variable to frame the Qry(that is then passed to Database for execution) which is as follows
0
1384
by: lucietee | last post by:
Hi, hope someone might be able to help. I have an ASP based portal site with about 15 users - it has a photo gallery section which allows users to submit their own pictures to the gallery. The problem is, the page for submission requires the file to already be online somewhere and asks the user to enter the direct url reference for the picture. My problem is that i want my users to be able to upload their own photos to our server. So i'm...
8
28417
by: Gianni Rondinini | last post by:
hi all. i've almost finished moving all the tags from html to my css. however, i can't find a way (if there's one) to move the property maxlength of an <input type=text ...tag to the css in which i define a class for my input's (colors, width, font and so on). i'd appreciate if anybody could tell me if i'm looking for something that doesn't exist or if i just cannot find it.
4
1676
by: Vikas Kumar | last post by:
propertyDescription += "<br>" + lblpropertyDescription.Text; //here i am reading some text from text area i test wrting "p" in my text area it wrks fine but when i write <pin my text area it gives the following error Error Message:A potentially dangerous Request.Form value was detected from the client (lblpropertyDescription=" "). Stack Trace: at System.Web.HttpRequest.ValidateString(String s, String
1
1952
by: hotrod57 | last post by:
I am trying to append the results from a form to a text file. My code is supposed to print out the results on one page, and append the results to another page each time data is entered on the form and the submit button is hit. Unfortunately, it is only printing out the message acknowledging the submit button--no data on either form. Here is the code below, please help if you can. PHP code that reads the form submission: <?php function...
3
1940
by: smokinlabbit | last post by:
I'm trying to come up with a solution (but with no real direction to start with) where I'm trying to edit data in a td element of a table on the spot. What I want to do is when a td element containing text is clicked on, the text within this td becomes an input text field. The data within the text field, upon submission, be it via a button or enter or whatever, will be the new data within the td element after submission. Is there a viable...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
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
10173
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...
1
7517
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5399
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...
1
4070
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
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.