Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
Disable part of an Input element

I am using intl-tel-input library for international phone number inputs. However I am only looking to allow users to select or change a country code but not enter a new phone number. So I am wondering how I can disable the phone number input but keep the countrycode dropdown

Phone Number Input

if I use the disable attribute on the input it does not allow country code selection. So this dropdown doesn't work when disable is used.

country code dropdown

Ideally users wouldn't be able to even click into the input (except for the dropdown piece)

<div class="slds-var-p-top_xx-small">
  <input  type="tel" class="slds-input" data-id="contactPhoneInput" name="country" value={user.Contact.Phone}></input>
</div>

//Javascript

const TELINPUT = window.intlTelInput;
const INITIALCOUNTRY = "us";
const PREFERREDCOUNTRIES = ["us", "ca", "mx"];

createPhoneInput(TELINPUT, TYPE) {
        const INPUT = this.template.querySelector(`[data-id=${TYPE}Input]`);
        this.intlTele[TYPE] = TELINPUT(INPUT, {
            utilsScript: RESOURCE_utilsjs,
            initialCountry: INITIALCOUNTRY,
            preferredCountries: PREFERREDCOUNTRIES
        });
    }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda