简体   繁体   English

错误错误:具有未指定名称属性的表单控件没有值访问器

[英]ERROR Error: No value accessor for form control with unspecified name attribute

<input type="email" class="form-control passname" [(ngModel)]="emailID" name="Passenger Email ID" placeholder="email" required pattern="^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$"/>
<div class="shake-tooltip-websearch-email" *ngIf="webEmailError != ''">{{webEmailError}}</div>
<div class="col-sm-4 col-xs-4 no-padding cont-code">
  <input class="form-control passenger-contact-number" type="text"  name="contCode" value ="+91" readonly>
</div>
<div class="col-sm-8 col-xs-8 contact">
  <input class="form-control contact-number" type="text" [(ngModel)]="contactNumber" name="contact-number" placeholder="Phone"  placeholder="Mobile Number" pattern="(?<!\d)\d{10}(?!\d)" requried minlength="10" maxlength="10" required />
  <div class="shake-tooltip-web-mobile" *ngIf="webMobileError != ''">{{webMobileError}}</div>
</div>

I am developing a contact details page, where the user needs to enter emailID and contact number, and if the fields are left empty , then the error tooltips will show up. 我正在开发一个联系人详细信息页面,用户需要在其中输入emailID和联系电话,如果这些字段留空,则将显示错误工具提示。 Everything is working fine, the email tooltip is not showing any console error, but for contact number, I am getting the 一切正常,电子邮件工具提示未显示任何控制台错误,但是对于联系电话,我得到了

ERROR Error: No value accessor for form control with unspecified name attribute 错误错误:具有未指定名称属性的表单控件没有值访问器

error. 错误。 Tried whatever solutions are provided in stackover flow, still nothing is working. 尝试了stackover流中提供的所有解决方案,但仍然没有任何效果。 Any suggestion? 有什么建议吗?

It's because you have a spelling mistake on the contact-number input. 这是因为您在联系电话输入中存在拼写错误。 You have 'required' twice and one of them is spelled 'requried'. 您两次“需要”,其中之一被拼写为“必需”。 Also you have two placeholders on that one. 同样,您在该占位符上有两个占位符。 And although it's not relevant to this, no id's, good practice to get into. 尽管与此无关,但没有ID,这是进入的良好实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular 4 错误:找不到具有未指定名称属性的控件 - Angular 4 Error: Cannot find control with unspecified name attribute Angular:尝试添加验证码。 错误 => 没有名称为“验证码”的表单控件的值访问器 - Angular: trying to add recaptcha. Error => No value accessor for form control with name: 'captcha' “没有名称的表单控件的值访问器”的问题 - A problem with "No value accessor for form control with name" 没有名称控件的值访问器-Angular 5 - No value accessor for form control with name - Angular 5 Angular form group:找不到具有未指定name属性的控件 - Angular form group: cannot find control with unspecified name attribute 表单控件没有值访问器 - No value accessor for form control 验证相同的密码输入角度2/4-错误找不到具有未指定名称属性的控件 - Validating Same Password Input Angular 2/4 - ERROR Cannot find control with unspecified name attribute 名称为“时间”angular 11 & primeng 的表单控件没有值访问器 - No value accessor for form control with name: 'time' angular 11 & primeng Angular4 - 表单控件没有值访问器 - Angular4 - No value accessor for form control FormArray:找不到angular6中未指定name属性的控件 - FormArray : Cannot find control with unspecified name attribute in angular6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM