kt511
kt511

Reputation: 25

make an input field required in ember.js

I know there is a way in plain html to require the field have some kind of value. I believe it's 'input required'. However, I'm not sure how to accomplish this in ember using handlebars. I've tried this but it was unsuccessful:

{{input required value=tax class="form-control" placeholder="State Tax"}}

Thanks in advance.

Upvotes: 0

Views: 2015

Answers (1)

Eduard Baitinger
Eduard Baitinger

Reputation: 91

In ember input helpers you always have to give values to attributes. The shourtcuts like <input disabled required value="..."/> in html without value are not allowed in handlebars. Instead you have to write {{input disabled=true required=true value="..."/>

See ember twiddle with your example: https://ember-twiddle.com/b073b4551065e8884056de55fe0c9800?openFiles=templates.application.hbs%2C

Upvotes: 5

Related Questions