Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="paper-input validation example" />
  <meta charset="utf-8">
  <title>JS Bin</title>
  
  <script src="http://www.polymer-project.org/components/webcomponentsjs/webcomponents.js"></script>
  <link href="http://www.polymer-project.org/components/paper-input/paper-input-decorator.html" rel="import">
</head>
<body>
  
  <template is="auto-binding">
  <paper-input-decorator id="decorator" label="Number" floatingLabel
                         error="is not a number">
    <input is="core-input" pattern="\d*" on-input="{{inputAction}}">
  </paper-input-decorator>
</template>
  
<script>
  var scope = document.querySelector('template[is=auto-binding]');
  
  scope.inputAction = function(e) {
    var d = document.getElementById('decorator');
    d.isInvalid = !e.target.validity.valid;
  }
</script>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
morethanrealpro
0viewers