Validating Polymer Paper Elements

放肆的年华 提交于 2019-12-25 04:50:24

问题


I'm building a polymer app that submits to a REST api and I've got all that up and running. But now I'm trying to add some simple validation to it and I can't figure out how to validate the paper-radio inputs. I just want to use HTML5 validation - but that may not be possible. The only thing is that I cannot use jQuery - its not an option for the project's parameters. Does anyone know how to validate the basic structure I'm using? (see below)

<paper-radio-group selected="{{selected}}">
  <paper-radio-button class="radio" value="{{value}}" name="{{name}}" label="{{label}}"></paper-radio-button>
  <paper-radio-button class="radio" value="{{value}}" name="{{name}}" label="{{label}}"></paper-radio-button>
  <paper-radio-button class="radio" value="{{value}}" name="{{name}}" label="{{label}}"></paper-radio-button>  
</paper-radio-group>

Thanks!


回答1:


Here's a recent article on 'Unit Testing Polymer Elements'

https://www.polymer-project.org/articles/unit-testing-elements.html



来源:https://stackoverflow.com/questions/27259897/validating-polymer-paper-elements

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!