NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Stu on October 29, 2013, 09:16:18 PM

Title: Default button on memory form (with no save button) not accepted on Enter keypre
Post by: Stu on October 29, 2013, 09:16:18 PM
Hey Bruce/Folks,

Nettalk 7.28, Clarion 8 (last)

Have got a memory form. The memory form has the save button removed.

There is a custom button on the form, with "Default" ticked.

When I have filled out the fields on the form, on the last field, I'd like to be able to click ENTER and the Default button to be "accepted".

Any chance either I've missed something, making a mistake OR that this could be done?
Title: Re: Default button on memory form (with no save button) not accepted on Enter keypre
Post by: Bruce on October 30, 2013, 02:48:18 AM
can you make a small example I can play with?

I'm not sure if it's possible - but I'll give it a go.

cheers
Bruce
Title: Re: Default button on memory form (with no save button) not accepted on Enter keypre
Post by: Larry Sand on October 30, 2013, 09:26:45 AM
Stu,
If i understand what you're asking, we use this on some jQuery dialogs to handle that:


var enterKeyHandler = function(formId, btnText) {
  $(formId).keypress(function(e) {
     if (e.keyCode == $.ui.keyCode.ENTER) {
        $(":button:contains('"+btnText+"')").trigger("click");
     return false;
      }
    });
};   


Larry Sand
Title: Re: Default button on memory form (with no save button) not accepted on Enter keypre
Post by: Stu on October 30, 2013, 02:33:26 PM
Thanks Gents.

Bruce .. Will do so if/when I can't work out a different issue which made me not use the Save button instead of a custom button!

Larry .. Nice! Thanks very much, cool beans.