Solved

Calling a Button on pressing Enter [Web]

Posted on 2006-11-29
6
269 Views
Last Modified: 2013-12-18
A form in web with 2 fields, 2 buttons , for example fields are Name, Age and buttons are Save Name, Save Age

If I enter Name and press enter, the form says 'form processed'. When the document is again opened, and I enter the age.


I want 'Save Name' button to be called/pressed when name is entered. And when the doc is opened and age is entered, by pressing enter key, I want 'Save Age' button to be called.

whats the way to call a button (or generate its formulas) by pressing Enter key ?

Thanks
0
Comment
Question by:ninteen83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 

Author Comment

by:ninteen83
ID: 18043177
2nd para was incomplete.

" If I enter Name and press enter, the form says 'form processed'. When the document is again opened, and I enter the age, and press enter, it again says 'form processed'.  "
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 18043516
This is becasue you don't have any $$Return field for redirecting to any page.

Also, you can validate those 2 fields and use on Submit event to process the form.
0
 

Author Comment

by:ninteen83
ID: 18043559
I'm using @URLOpen in the buttons. My question was how can I prevent the form being saved and display form process by press Enter key, Pressing Enter should process the formulas in Save Name/Save Age buttons
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:madheeswar
ID: 18044059
In the onKeydown event of the form,
place below code:

if(event.keyCode==13){
return false;
}

0
 
LVL 3

Accepted Solution

by:
Joep8020 earned 125 total points
ID: 18118813
Also:

Give the button an id (on the HTML tab of the button properties) e.g. buttonID, then use the script:
if(event.keyCode==13){
document.getElementById("buttonID").click();
}
0
 

Author Comment

by:ninteen83
ID: 18120068
it worked. thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question