null pointers after user hits enter in AJAX form

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

null pointers after user hits enter in AJAX form

Qbyte Consulting
An unrecoverable error occurs after the user hits Enter key in a form
rendered by an enclosed component.

Is there a way to ignore the enter key and not submit the form? It's an
AJAX search value input, not a regular form for submission, so Enter key
hits should be ignored.




<form t:type="form" t:autofocus="true">
<t:UsersComponent t:selectedUserId="selectedUserId" t:zoneId="editZone" />
</form>
Reply | Threaded
Open this post in threaded view
|

Re: null pointers after user hits enter in AJAX form

Nathan Quirynen
Hi,

I'm not really sure what your problem is, but for disabling the enter
key you might wanna try binding the following event in a javascript module:

|$('#'+fieldId).bind('keypress',function(e){if(e.keyCode
==13){returnfalse;}}); |

You can invoke this module from your component, or create a mixin that
you add to the field(s) / component.

Nathan


On 18/08/16 19:20, Qbyte Consulting wrote:

> An unrecoverable error occurs after the user hits Enter key in a form
> rendered by an enclosed component.
>
> Is there a way to ignore the enter key and not submit the form? It's an
> AJAX search value input, not a regular form for submission, so Enter key
> hits should be ignored.
>
>
>
>
> <form t:type="form" t:autofocus="true">
> <t:UsersComponent t:selectedUserId="selectedUserId" t:zoneId="editZone" />
> </form>
>