Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why pressing Enter does not trigger the search?
Message
From
07/04/2016 13:27:48
 
General information
Forum:
CSS
Category:
Troubleshooting
Miscellaneous
Thread ID:
01634461
Message ID:
01634512
Views:
32
Likes (1)
>>maybe I should expand a little more (general JS experience, not AngularJS)
>>
>>
>><div class="input-group" style="margin-top: 20px;" ng-keyup="function(e){if ((e.which || e.keyCode) === 13 /*enter*/ && $(this).find('input').val().length ) doSimpleSearch(simpleSearch)}">
>>
>>
>No, this didn't work
>
>
>I like the solution from here
>
>http://stackoverflow.com/questions/17470790/how-to-use-a-keypress-event-in-angularjs
>
>I'll go for it.
>
>UPDATE.
>
>This worked nice in Google Chrome:
>
>
> <div class="input-group" style="margin-top: 20px;" >
>                        @*http://stackoverflow.com/questions/17470790/how-to-use-a-keypress-event-in-angularjs*@
>                        <input type="text" class="controls form-control" ng-model="simpleSearch" 
>                               placeholder="@Labels.search" 
>                               ng-keydown="$event.which === 13 && doSimpleSearch(simpleSearch)" />
>                        <span class="input-group-btn">
>                            <button class="btn btn-default"
>                                    ng-click="doSimpleSearch(simpleSearch)">
>                                @Labels.search
>                            </button>
>                        </span>
great, and this teaches me some Angular as well
win-win collaboration!
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Previous
Reply
Map
View

Click here to load this message in the networking platform