var nav = window.Event ? true : false;
if (nav) {
window.captureEvents(Event.KEYDOWN);
window.>} else {
document.
}
function NetscapeEventHandler_KeyDown(e) {
if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit')
{
if(ValidateFormForLT())
{
document.forms['thisform'].action='';
document.forms['thisform'].submit();
}
return false;
}
else
return true;
}
function MicrosoftEventHandler_KeyDown() {
if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
{
if(ValidateFormForLT())
{
document.forms['thisform'].action='';
document.forms['thisform'].submit();
}
return false;
}
else
return true;
}
you'll have to change the form name in the above from "thisform" to whatever the name of your form is, and you'll have to change where it sets the form's action to where ever you want the page to go to when your user presses enter, but using the above _javascript_ you can make it so when a person presses enter on your page you can control where it takes them instead of being stuck to the action of the first button. Also the above could be modified so that when the user presses enter, nothing happens at all if you wanted it to do that.
I have two buttons on a page with a form. When you hit the enter key on your
keyboard it takes you to the 1st button when we would prefer it uses the
second. Is there a way to prevent the enter key from doing anything? Or do
we just have to switch the order of the buttons.
The 1st one finalizes payment the second continues shopping.
I guess in want to know this for general information. In this case it makes
sense to force the user to actually click the button since it charges their
card
--
Dan Stein
FileMaker 7 Certified Developer
Digital Software Solutions
799 Evergreen Circle
Telford PA 18969
Land: 215-799-0192
Cell: 610-256-2843
Fax 413-410-9682
FMP, WiTango, EDI,SQL 2000, MySQL, CWP
[EMAIL PROTECTED]
www.dss-db.com
'I wonder why we say that people are of different "races". It seems to me,
we're all running at the same speed and heading towards the same
destination. The only "winners" are the ones who've made the world a better
place for having been here.'
From for Better or Worse 2/28/2006
________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
________________________________________________________________________ TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
