admin管理员组文章数量:1414869
I have a problem with "Form input without an associated label". This appears on [textarea], [select], [select], [input] classes.
Here is my code:
<div class="panel-body">
<form name="f" data-ng-submit="addTodo()">
Nazwa:
<textarea class="form-control" name="newTodo" data-ng-model="formData.newTodo" required></textarea>
Typ:
<select class="form-control" name="type" data-ng-model="formData.type" data-ng-option="value.name for value in categories" required></select>
Estymowany czas:
<select class="form-control" name="estimates" data-ng-model="formData.estimates" data-ng-option="value + 'h' for value in [] | rangeTime:9:true" required></select>
Data:
<input class="form-control" type="text" data-ng-model="formData.date" data-ng-data-picker="" name="date" required readonly="readonly">
<br />
<button class="btn btn-success" data-ng-disabled="f.$invalid">Add <span class="glyphicon glyphicon-ok"></span></button>
</form>
Thanks for help!
Moderator Clarification: The quoted message stated above is a warning provided by JetBrains products within the IDE. The OP is most likely using either WebStorm or IntelliJ for front-end development.
I have a problem with "Form input without an associated label". This appears on [textarea], [select], [select], [input] classes.
Here is my code:
<div class="panel-body">
<form name="f" data-ng-submit="addTodo()">
Nazwa:
<textarea class="form-control" name="newTodo" data-ng-model="formData.newTodo" required></textarea>
Typ:
<select class="form-control" name="type" data-ng-model="formData.type" data-ng-option="value.name for value in categories" required></select>
Estymowany czas:
<select class="form-control" name="estimates" data-ng-model="formData.estimates" data-ng-option="value + 'h' for value in [] | rangeTime:9:true" required></select>
Data:
<input class="form-control" type="text" data-ng-model="formData.date" data-ng-data-picker="" name="date" required readonly="readonly">
<br />
<button class="btn btn-success" data-ng-disabled="f.$invalid">Add <span class="glyphicon glyphicon-ok"></span></button>
</form>
Thanks for help!
Share Improve this question edited Jun 25, 2015 at 13:19 MegaMatt 23.8k39 gold badges114 silver badges160 bronze badges asked Jun 14, 2015 at 12:21 MordziastyMordziasty 811 silver badge5 bronze badges 4Moderator Clarification: The quoted message stated above is a warning provided by JetBrains products within the IDE. The OP is most likely using either WebStorm or IntelliJ for front-end development.
- What are you talking about? Where you see that message and when? – user447356 Commented Jun 14, 2015 at 12:24
- The msg appears while I set the cursor on : <textarea class> <select class> <input class> – Mordziasty Commented Jun 14, 2015 at 12:30
- You mean in your IDE? If so what IDE? Please give full and correct details, don't have us squeeze the information out of you bit by bit. – user447356 Commented Jun 14, 2015 at 12:35
- dfsq answered the question. The problem disappeared. – Mordziasty Commented Jun 14, 2015 at 12:40
2 Answers
Reset to default 5This is not an error, however it's remended to associate labels with corresponding form elements for the sake of UX convenience. For example for the name field:
<label for="name">Nazwa:</label>
<textarea class="form-control" id="name" name="newTodo" data-ng-model="formData.newTodo" required></textarea>
I assume your IDE is smart enough to identify missing labels and provide you with a reasonable suggestion to add those.
I guess WebStorm
?
just follow the advice and add the label.
label
is useful especially for radio
, checkbox
so that you can active them by merely clicking on the label.
本文标签: javascriptAngularJSJQueryform input without an associated labelStack Overflow
版权声明:本文标题:javascript - AngularJSJQuery - form input without an associated label - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745218619a2648288.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论