You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Qbyte Consulting <qb...@gmail.com> on 2016/08/18 17:20:46 UTC

null pointers after user hits enter in AJAX form

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>

Re: null pointers after user hits enter in AJAX form

Posted by Nathan Quirynen <na...@pensionarchitects.be>.
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>
>