Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Polymer input change event

All I want is to be able to get the input from a polymer element <paper-input> and alert it onchange WITHOUT creating a custom polymer element.

issues: on-change doesn't do anything I doubt this.value will do anything

Pseudocode:

<!DOCTYPE html>
<html>
  <head><!--insert proper head elements here--></head>
  <body>
    <paper-input floatingLabel label="test" on-change="alert(this.value)"></paper-input>
  </body>
</html>
like image 841
Cygnini - ShadowRi5ing Avatar asked Jul 24 '14 17:07

Cygnini - ShadowRi5ing


1 Answers

I don't know if the OP wanted a change callback while typing...but for Polymer 1.0+ one can listen to the changes while typing simply use the on-input instead of on-change "event"

<paper-input label="Enter search term" on-input="search" value="{{searchTerm}}">
like image 53
ohager Avatar answered Oct 13 '22 20:10

ohager