You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Janne Hietamäki (JIRA)" <ji...@apache.org> on 2006/10/16 18:35:39 UTC

[jira] Commented: (WICKET-2) Input field with autocomplet behavior does not submit the form via enter key

    [ http://issues.apache.org/jira/browse/WICKET-2?page=comments#action_12442637 ] 
            
Janne Hietamäki commented on WICKET-2:
--------------------------------------

I tried similiar fix few weeks ago, and it causes the browser to submit the form when selecting an item with enter (tested with safari and firefox on mac).




> Input field with autocomplet behavior does not submit the form via enter key
> ----------------------------------------------------------------------------
>
>                 Key: WICKET-2
>                 URL: http://issues.apache.org/jira/browse/WICKET-2
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-extensions
>    Affects Versions: 1.2.2
>            Reporter: Tomáš Drenčák
>         Assigned To: Janne Hietamäki
>         Attachments: wicket-autocomplete.js
>
>
> When field has a focus, autocomplete javascripts blocks all enter key presses. That's why form can't be submitted. Enter key press should be blocked only when autocomplete view is visible
> You can change wicket-autocomplete.js in initialize() function:
> from
>         obj.onkeypress=function(event){
>             if(wicketKeyCode(getEvent(event))==KEY_ENTER){
>                 return killEvent(event);
>             }
>         }
> to
>         obj.onkeypress=function(event){
>             if(wicketKeyCode(getEvent(event))==KEY_ENTER && visible==1){
>                 return killEvent(event);
>             }
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira