How to format number input in angular

Issue I have a number input like this and i want something like this (no matters what the sepparator will be) My actual code works as follows: <div class=”row center-xs” *ngFor=”let item of listItem;let i=index”> <div class=”col-xs-12 col-md-10″> <mat-form-field> <input

Continue reading

Get Value of Input Button When Clicked for Only One Button?

Issue So I made this formula for my input button function addTip() { let tip = document.querySelectorAll("input[type=button]"); tip.forEach((item) => { item.addEventListener("click", (event) => { console.log(item.value); }); }); } HTML <input type="button" value="3" onClick="addTip()"> <input type="button" value="5" onClick="addTip()"> <input type="button" value="7"

Continue reading

Jquery remove all inputs with same class except one

Issue I want to remove all input labels with same class except one in div #tikersDiv. I got this script but it doesn’t work: $(‘#tikersDiv’).children(‘label’).each(function(i){ let removed = $(‘#id_’ + (++i)).children(‘label’).each(function(){ $(this).remove(); }); $(this).append($(removed[0]).html()); $(this).append($(removed[3]).html()); }); Solution Ok, I’ve got

Continue reading

PHP preg_match not working as Input pattern

Issue So I have this input pattern in HTML: <input name="firstnamereg" type="text" pattern="[/\p{L}+/u ]+"> But When I use the preg_match it does not work: $regexFirstANDLastname = "/[/\p{L}+/u ]+/"; preg_match($regexFirstANDLastname, $_POST["firstnamereg"]); Solution You need to use pattern="[\p{L}\s]+" This pattern, in Chrome

Continue reading

4 input & Dynamically change transform

Issue I’m trying to make a transform generator. Users will constantly update this, but without success. Because when I use jquery element.css(‘transform’, …. it changes it to singleton. But, I can’t change other elements. HTML <p>ROTATE X</p> <input class="inputrange" name="transformRx"

Continue reading

How to input without change focus

Issue Building an editor like below– I need the user to be able to select some text but then use the input to do something without losing the selection. function doReplace(){ const s = document.getSelection() if(s?.anchorNode.parentElement.id != “out”)return; console.log(‘replace’) out.innerText

Continue reading

How to add static text inside an input form

Issue How can I put this static text in an input form? It’s there all the time. This is my code: <label for=”subdomain”>Subdomain:</label> <input type=”text” placeholder=”ExampleDomain” id=”subdomain”/> Solution HTML <label for=”subdomain”>Subdomain:</label> <input type=”text” placeholder=”ExampleDomain” id=”subdomain” /> <input type=”text” id=”subdomaintwo” value=”.domain.com”

Continue reading

Set autocomplete off for Formik field

Issue To set the autocomplete off for a simple input it must be done like this: <input type="text" autocomplete="off"> In this case, there is a Formik Field and the input looks like this: <Field className="my-class" name="myValues" as={Input} placeholder="Write something" />

Continue reading

Set autocomplete off for Formik field

Issue To set the autocomplete off for a simple input it must be done like this: <input type="text" autocomplete="off"> In this case, there is a Formik Field and the input looks like this: <Field className="my-class" name="myValues" as={Input} placeholder="Write something" />

Continue reading

In Angular @Input() doesn't work for the simplest hardcoded string input

Issue I have admin.users.list.html as the parent template, which inputs some data to the child component: <general-entities-list-container *ngIf="{ entityType: entityType$ | async } as asyncData" [entityType]=’asyncData.entityType’ [entityTypeHardCoded]="’users’" [entityTypeSet]="’users’" > </general-entities-list-container> I have general-entity-list-container.html (child template): entityType is:{{ entityType }} <br/>

Continue reading

How to change html input value inside a grandchild component from grandparent component

Issue I have a WidgetsModule where I’ve created an input component input.component.ts import { AfterViewInit, Component, Input, OnInit, Output, ViewChild } from ‘@angular/core’; @Component({ selector: ‘app-input’, templateUrl: ‘./input.component.html’, styleUrls: [‘./input.component.css’] }) export class InputComponent implements OnInit, AfterViewInit { @Input() Nombre:string

Continue reading

Audio not playing in Angular 7

Issue I’m doing a big Angular 7 project for myself and I want some background music in it. So I use this: <audio id=”audio” *ngIf=”ship.dock != true” autoplay=”true” loop=’true’ style=”position: absolute; z-index: -1;”> <source src=”src/assets/music/space.mp3″ type=”audio/mp3″> </audio> ship.dock is set

Continue reading