Solved

Calling a Button on pressing Enter [Web]

Posted on 2006-11-29
6
263 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now