The form control is missing a specified name attribute, causing an error with the value accessor

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

For the development of a contact details page, I have implemented input fields for emailID and contact number. Error tooltips are displayed when these fields are left empty. Although there is no issue with the email tooltip, I am encountering the following error message specifically for the contact number:

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

Despite attempting solutions suggested on platforms like Stack Overflow, this error persists. Any advice or alternative approach to rectify this issue would be greatly appreciated.

Answer №1

The issue stems from a typo in the contact-number input field where 'required' is misspelled as 'requried'. Additionally, there are two placeholders present in that field. It's also worth noting that having multiple id's is not considered good practice.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What are the steps to increase or decrease the quantity of a product?

Is there a way to adjust the quantity of products in the shopping cart? I would like to be able to increase and decrease the quantity, while also displaying the current value in a span tag. <a href="javascript:" id="minus2" onclick="decrementValue()" ...

How can I transmit information to the model without relying on query string parameters in Express?

Currently, I am working with two controllers - authController and onboardingController. The authController communicates with the onboardingController using the following line of code: res.redirect('/onboarding/info?profileId=' + profile.id + &ap ...

"Troubleshooting: Issues with the ng-hide directive in AngularJS

I am facing an issue with hiding a column in my table using ng-hide. The goal is to hide the column before the user logs in and then show it after they have logged in. However, I found that after applying the ng-hide property, the entire table gets hidden ...

Why is my Ajax utilizing PHP _POST not functioning as expected?

I am facing an issue with the JavaScript code below: <script src='https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js'></script> <script> function deletUserInfo(id_user){ console.log(id_user); ...

Teach Typescript to recognize a specific union type within a React component

Imagine I have an object of type: type BulkItem = { id: number; type: 'bulk'; tonnage: number } type RegularItem = { id: number; type: 'regular'; weight: number } export type CartItem = BulkItem | RegularItem // there could be more item ...

Attempting to format a number using a computed property and .toLocaleString() fails to execute

I am facing an issue with the formatting of a number displayed in a <p></p> element. The number is coming from a range input element that is bound to an amount data property using v-model. Even though I have a computed property to format the nu ...

Ways to establish a minimum height for material cards using Material UI

I am facing an issue with a card that contains a nested table. The card expands and shrinks based on the size of the table inside it. I want to prevent the card from shrinking when the table has no data or just one entry. Instead, I need the card to mainta ...

Using the <script> attribute within the <head> tag without the async or defer attributes

https://i.stack.imgur.com/cRFaR.pngCurious about Reddit's use of the async or defer attribute in the script tag. Are there situations where blocking the parser is necessary? ...

Can regex matching characters be made easier to understand?

I am working on creating an ECMAScript (JavaScript) flavored regex to evaluate the complexity of my password based on specific criteria: Characters Used Password Strength Length ABC abc 123 #$& WEAK ... 1 x ...

Convert YAML to an array of objects instead of using named objects in npm parsing

Currently, I am utilizing npm's YAML parser to convert YAML into an object. However, instead of getting an array, I am receiving a group of named objects. This issue arises from the absence of dashes preceding the objects. How can I transform this gr ...

Obtaining the pathname in a NextJS file like _document.js is a matter of accessing

I'm looking to retrieve the current URL path in my /page/_document.js file. I've created a class and my goal is to implement a conditional statement based on this value. Below is the code snippet (similar to the example provided in NextJS docume ...

Error in Angular 6: String provider is missing from the NullInjector

Parent class import { BadRequestError } from './../common/bad-request-error'; import { NotFoundError } from './../common/not-found-error'; import { AppError } from './../common/app-error'; import { Http } from '@angular/ ...

Tabulate the number of items in an array based on the month and

I have received JSON data with dates indicating the creation time of multiple parcels. I want to analyze this data and calculate the total number of parcels created in each month. I am new to this process and unsure about which thread on Stack Overflow can ...

Guide to establishing a connection with a Node.js socket server

I'm delving into the world of node JS and experimenting with creating a real-time application that involves a node JS server using socket.io, along with a unity application that can communicate with it. Below is the code I used to set up the server w ...

Leveraging Webworkers in an Angular application for efficient data caching with service workers in the Angular-CLI

I am looking to run a function in the background using a worker, with data coming from an HTTP request. Currently, I have a mock calculation (e.data[0] * e.data[1] * xhrData.arr[3]) in place, but I plan to replace it with a function that returns the actual ...

Error Message: Nodemon Node Error - Module 'C:Program FilesGit ode_modules odemonin odemon.js' Not Found

Currently diving into the world of NodeJS. Running a Windows 7 64 Bit setup. Node.js and NPM are up and running smoothly. Nodemon is also installed locally and globally. When trying to execute the command: "nodemon server.js" or simply "nodemon" An er ...

Is it possible for me to set a timer on the 'keyup' event in order to decrease the frequency of updates?

The code I currently have is functional: $wmdInput.on('keyup', function () { var rawContent = $wmdInput.val(); scope.$apply(function () { ngModel.$setViewValue(rawContent); }); }); Unfortunately, it appears to slow down my t ...

JavaScript refuses to connect with HTML

Just starting out in the world of programming, I decided to dive into a Programming Foundations class on Lynda.com. However, after following along for fifteen minutes, I encountered an issue - I couldn't seem to connect my JavaScript file to my HTML f ...

Design a captivating Profile Picture form using HTML and CSS styling

In my form, I am looking to include a user's Profile picture which should be displayed in either a circular or rectangular shape. Initially, the image area will show a black background or a placeholder image. When the user clicks on this area, they sh ...

Import a picture file into Photoshop and position it at a designated location

I need assistance with developing a function that can load an image and position it at specific x, y coordinates in Photoshop. Below is the code I have so far: var docRef = app.activeDocument; function MoveLayerTo(fLayer, fX, fY) { var Position = fLaye ...