NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: alex.kolaric on December 21, 2011, 02:40:20 PM

Title: NT5 - Enter key submits form - Can it be prevented
Post by: alex.kolaric 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
Title: Re: NT5 - Enter key submits form - Can it be prevented
Post by: kevin plummer 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.
Title: Re: NT5 - Enter key submits form - Can it be prevented
Post by: Bruce 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
Title: Re: NT5 - Enter key submits form - Can it be prevented
Post by: alex.kolaric on December 22, 2011, 03:51:16 AM
Thanks Bruce,

I will check Javascript.

Regards,
Alex