Solved

Calling a Button on pressing Enter [Web]

Posted on 2006-11-29
6
267 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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