javascript - AngularJSJQuery - form input without an associated label - Stack Overflow

I have a problem with "Form input without an associated label". This appears on [textarea], [

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!

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.

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 4
  • 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
Add a ment  | 

2 Answers 2

Reset to default 5

This 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745218620a4617142.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信