Solved

Calling a Button on pressing Enter [Web]

Posted on 2006-11-29
6
265 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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

777 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