How to Restrict User to Enter Date Manually in Date Field using AngularJS ? Last Updated : 06 Sep, 2022 Suggest changes Share Like Article Like Report In this article, we will see how to restrict the user to enter the date manually in the date field using AngularJS, along with understanding its implementation through the example. Approach: First, we need to write the code for input, and we need to give its type as the date in the HTML file.Then in-order to restrict the user to enter the date manually we can use onkeydown event.In the onkeydownevent we need to return false so that we can restrict the user to enter the date manually.In order to achieve the above objective, we need to write and function and return a false in the ts file.As we restricted the user to enter the date normally, the user can only enter the date from the calendar.After completing the above steps save and run the project in order to see the output.Example: This example illustrates restricting the user to enter the date manually in the date field using AngularJS. app.component.html <div style="text-align:center"> <h1 style="color:green">GeeksforGeeks</h1> <h3> Restricting the user to enter date manually in date field </h3> <label for="vote">Select a date:</label> <input type="date" id="vote" name="vote" (keydown)="disableDate()"> </div> app.component.ts import { Component } from "@angular/core"; @Component({ selector: "my-app", templateUrl: "./app.component.html", styleUrls: ["./app.component.css"], }) export class AppComponent { disableDate() { return false; } } app.module.ts import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { FormsModule } from "@angular/forms"; import { AppComponent } from "./app.component"; @NgModule({ imports: [BrowserModule, FormsModule], declarations: [AppComponent], bootstrap: [AppComponent], }) export class AppModule { } Output: Advertise with us Next Article How to Restrict User to Enter Date Manually in Date Field using AngularJS ? B bunnyram19 Follow Similar Reads How to set the input field value dynamically in AngularJS ? Given an input field and the task is to set the input field value dynamically with the help of AngularJS.Approach: A value is being set to the input field despite the user enter something or not. ng-click event is used to call a function that sets the value to 'This is GeeksForGeeks' with the help o 2 min read How to Sort List by Date Filter in AngularJS ? AngularJS is a feature-based JavaScript framework that uses various tools to create dynamic single-page web applications. While developing the application we have the requirement to play with the data in AngularJS and sort this list of data by a date properly in descending order. This can be done us 5 min read How to change the date format using AngularJS ? In this article, we will see how to change the date format using AngularJS. AngularJS provides 2 different ways to change the format of the date. It can be achieved by the following approaches: Using HTML Template BindingUsing JavaScript ControllerHTML Template Binding: In this method, we use the pi 3 min read How to make Datepicker using Angular UI Bootstrap ? In this article, we will see how to make Datepicker using Angular UI bootstrap. Angular UI Bootstrap is an Angular JS framework created by Angular UI developers for providing better UI which can be used easily. Syntax: <div uib-datepicker></div> Download AngularUI from the link: https:// 1 min read How to create a Datetime Input using jQuery Mobile ? jQuery Mobile is a web based technology used to make responsive content that can be accessed on all smartphones, tablets, and desktops. In this article, we will be creating a Datetime input area using jQuery Mobile. Approach: Add jQuery mobile scripts needed for your project. <link rel=âstyleshee 1 min read Article Tags : Web Technologies AngularJS AngularJS-Questions Like