Using JS easy to implement Ionic call keyboard search function (Super practical) _javascript tips

Source: Internet
Author: User

This demand is product mention, at first just set up <input style= "padding-top:3px;" type= "Search" placeholder= "searching doctor or Hospital" ng-model= "Query" >

Type= "Search"

Found that Android can not get the search for iOS, I'm mad, after Google's search to get the conclusion that need to apply a form form outside, so add a really well and combined with the form submitted by the event directly call the button button click event ng-click= "Searchselect ()", do not need to listen for additional search keyboard Click events, saved a lot of trouble, really very practical ah, I was a genius

The HML code is as follows:

<form>
<div class= "bar bar-header item-input-inset" style= "height:50px;" >
<label class= "Item-input-wrapper" id= "Search-input" >
<i class= "icon Ion-ios-search" style= " position:relative;color:gray;font-size:1.5em;top:1px; " ></i>
<input style= "padding-top:3px" type= "search" placeholder= "searching doctor or Hospital" ng-model= "Query" >
</label>
<button class= "button button-clear" style= "color: #49B746;" ng-click= "Searchselect ()" > Search </button>
</div>
</form>

The JS code is as follows:

$scope. Searchselect = function () {
if ($scope. Currentsearchtype = = ' Hospital ') {
}else{
$scope. Search ();
}
};

The above is a small set to introduce the use of JS easy to achieve Ionic call keyboard search function (Super practical), hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.