When viewed on a mobile device, the page defaults to displaying the NumPad instead of the Text Keyboard in Angular

The email field in my angular app is opening a Key Pad in mobile view and I'm not sure why.

<form (ngSubmit)="onSubmit()" #emailForm="ngForm">
            <div class="emailaddress" style="text-align:center;" *ngIf="!showEmail">
                <div style="font-size: 20px; display: inline-block;">
                    My email address is:
                </div>   
                <div style="display: inline-block;">
                    <label for="emailAddress" class="visually-hidden">My email address is</label>
                    <input name="emailAddress" id="emailAddress" type="tel" maxlength="50" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f380929e839f96b3969e929a9a9fdd909c9e">[email protected]</a>" [(ngModel)]="emailClass.emailAddress" pattern="([A-Za-z0-9-!#$%&_+`{}|']+)?(\.[A-Za-z0-9-!#$%&_+`{}|']+)*@[A-Za-z0-9-]+\.([A-Za-z0-9]{2,})+" aria-required="true" required/>
                </div>
                <div style="margin-bottom: 0px; margin-top: 20px;" class="error-generic" *ngIf="emailForm.touched && (emailForm.form.controls['emailAddress'].invalid && emailForm.form.controls['emailAddress'].touched)">
                    <svg height="32" viewBox="0 0 32 32" width="32"><path d="..." fill="#6d6e71"></path></svg>
                        Correct the email field to continue.
                </div>
                <div style="margin-top: 20px;">
                    <button id="email-me" class="button large" [disabled]="!emailForm.form.valid">Send Email</button>
                </div>
            </div>
        </form>

Answer №1

To adjust the input, switch the type to "email".

<input name="emailAddress" id="emailAddress" type="email" maxlength="50" placeholder="<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="90e3f1fde0fcf5d0f5fdf1f9fcbef3fffd">[email protected]</a>" [(ngModel)]="emailClass.emailAddress" pattern="([A-Za-z0-9-!#$%&_+`{}|']+)?(\.[A-Za-z0-9-!#$%&_+`{}|']+)*@[A-Za-z0-9-]+\.([A-Za-z0-9]{2,})+" aria-required="true" required/>

The < input type="tel"> creates a section for inputting phone numbers.

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

Unable to utilize navigator.camera.getPicture in iOS while using PhoneGap Adobe Build

I've spent hours searching, trying to troubleshoot my PhoneGap app (compiled by Adobe PhoneGap Build) and I suspect there's something crucial about PhoneGap that I'm missing. I've added the following lines to the config.xml file: <f ...

CSS: The button appears to be slightly lower than the label

For more information, check out this GitHub link Here is the HTML code snippet: <div class="col-md-12"> <div class="col-md-2"> Processing </div> <div class="col-md-4"> <button class="btn btn-primary">Hello</ ...

Utilizing Angular 2 to Implement Remote Validation Error Handling in Forms

Whenever I submit a form to my backend, there is a chance that I will receive a response with HTTP code 400, which means that the validation has failed. An example of the response from my backend could be: { "status":"fail", "data":{ "email": ...

Cookie authentication in CodeIgniter with Angular HTTP requests in Ionic 3

I am experiencing difficulties sending POST/get requests to the server. When using the Postman Chrome extension, everything works fine. However, when attempting to use Angular Http (not HttpClient) in Ionic, I encounter errors. The first error is related t ...

Assess how my website is displayed to an algorithm

A website can be accessed not just by a user through a browser, but also by programs, bots, and crawlers. I have a website hosted on Google App Engine with Python that features non-static HTML pages generated by a Python program by manipulating strings. Th ...

Tips for discovering the exact positions of child divs that are Nth siblings within a parent div

I have designed a new calendar interface with dynamic functionality. When the user clicks on any time slot displayed in IMAGE1, a span element is created dynamically to represent 8 hours starting from that clicked time. My question is, how can I access th ...

Jest unit tests in Angular using Typescript are not detecting failures when it comes to console errors or unrecognized elements

In my Angular Typescript project, I am facing an issue with my Jest unit test. The test does not fail even if a component (e.g., mat-paginator without importing MatPaginatorModule in configureTestingModule) or template bindings (e.g., [mask] directive from ...

Easily validating forms using javascript

I'm attempting to design a basic HTML form and would like to implement javascript for validating the input values. Below is the form tag: <form action="" onSubmit="return formValidation();" method="Post" name="form"> Here is a section of the ...

Trouble embedding iframes in local files?

I have recently created a file which includes the following code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8> <style> iframe { height: 500px; width: 600px; } ...

Injecting SVG styling into HTML using the content tag and CSS

I am working with 3 different files: index.html <!DOCTYPE html> <html> <head> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <body> <i class="logo myRed" aria-hidden="true"></i> ...

Exploring WordPress's Query Page with Posts

My current code successfully pulls posts from a specified category, but I am struggling to also include pages in the output. I have tried various methods, but haven't been able to pull in both posts and pages at the same time. HTML/PHP <?php quer ...

Exploring Angular 2 Tabs: Navigating Through Child Components

Recently, I've been experimenting with trying to access the HTML elements within tabs components using an example from the Angular 2 docs. You can view the example here. Here is a snippet of my implementation: import {Component, ElementRef, Inj ...

Using a template reference variable as an @Input property for another component

Version 5.0.1 of Angular In one of my components I have the following template: <div #content>some content</div> <some-component [content]="content"></some-component> I am trying to pass the reference of the #content variable to ...

The button component in my React application is not functioning as expected, despite utilizing the useState and useEffect hooks

I'm having trouble with my Button not working, even though I am using useState and useEffect Check out the code below: import React, { useState, useEffect } from "react"; // import Timeout from "await-timeout"; import ...

Guide on implementing iterative data path in v-for loop using Vue

I'm just starting out with Vue and I want to use image file names like "room1.jpg", "room2.jpg", "room3.jpg" in a loop Below is my code, where the second line seems to be causing an issue <div v-for="(p,i) in products" :key="i"> <img src ...

Retrieve the HTML content of all children except for a specific child element in jQuery

Is there a way to utilize jQuery/Javascript for selecting the HTML content of the two <p> elements in the initial <div class="description? I'm open to using Regex as well. This specific jQuery selection is being executed within Node.js on a c ...

Learn the process of seamlessly uploading various document formats, videos, and previewing documents with Angular software

I am having trouble viewing uploaded files in the carousel. While I can see video and image files, other document formats are not displaying. Can someone please recommend a solution to enable viewing all types of documents as well? mydata = [] onSelect ...

Reduce the dimensions of a CSS attribute automatically

Displayed below is the image with a width of 192 and height of 109: <a href="https://www.blogger.com/u/1/blogger.g?blogID=4402911157743442948#"><img alt="" class="thumbnail" height="109" src="https://2.bp.blogspot.com/-E5ftfbCCgkw/XjnLpO347cI/AAA ...

The Firestore query for viewing resources is currently not functioning as expected due to issues with

I'm currently working on implementing the "read" Rules from an array, following the guidelines in this blog post var db = firebase.firestore(); db.collection("_users").where("viewers", "array-contains", myUID) .get() .then((querySnapshot ...

unable to display loading image prior to upload

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html lang="en"> <head> <title>Unique Prints</title> <meta charset="utf-8"> <meta name="viewport" conte ...