NetTalk Central

Author Topic: NT5 - Enter key submits form - Can it be prevented  (Read 3790 times)

alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
NT5 - Enter key submits form - Can it be prevented
« on: December 21, 2011, 02:40:20 PM »
Hi,

I have a form without Save bttn and none of the buttons on the form are marked as default. When I click on any entry field on the form and press Enter on the keyboard page gets submitted. Is this normal behavior? I saw that form has action attribute which points to whatever I put in "Url on save" template field, however my form doesn't have Save bttn. and if I remove this value action gets populated by some other page name - I think it is caller page name.

Is there any way to prevent submit on Enter key?

thanks,
Alex

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: NT5 - Enter key submits form - Can it be prevented
« Reply #1 on: December 21, 2011, 04:39:29 PM »
Add some validation code to Validate all embed so if some SSV is not set it will throw a warning and not continue.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: NT5 - Enter key submits form - Can it be prevented
« Reply #2 on: December 22, 2011, 12:29:28 AM »
Alex,

In NT5 it's not likely to change, and it would take some creative JavaScript to suppress the Enter - the submit is being done by the browser - that's the default behavior for enter on a form. It can be suppressed with JavaScript though - and it's something we could add to the list for NT6.

cheers
Bruce

alex.kolaric

  • Full Member
  • ***
  • Posts: 151
  • Do it or do not, there is no try
    • View Profile
    • Email
Re: NT5 - Enter key submits form - Can it be prevented
« Reply #3 on: December 22, 2011, 03:51:16 AM »
Thanks Bruce,

I will check Javascript.

Regards,
Alex