javascript - search in textbox for different fields help is required -


we have requirement, search different fields using single text box. example, search has based on 3 fields; product, brand , place.

initially user given below text in textbox cannot modified: product:-brand:-place

when user wants search product, brand , place, add values: product:"tv"-brand:"samsung"-place:"london"

when user wants search product: product:"tv"-brand:-place

can body me, how can done in jquery or angular js?

this can done using angular filter..

you can pass object second parameter achieve if can have 2 search fields

<div ng-repeat="friend in user.friends | filter:{name:searchnametext, age:searchagetext}"> 

otherwise you'll need write custom filter use same field both, or pass custom filter function third parameter described in docs.

http://docs.angularjs.org/api/ng.filter:filter


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -