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

145
Visualizações
How to set input field restrictions in next.js

My input field restrictions arent working and it doesnt stop the submit button from working. I took out a majority of the code on the page to focus on the problem. None of my restrictions work. I am also having this problem in other spots on my page, but I'm guessing its one fix for all.

        if (!Boolean(userToken))
            return (
                <>
                    <div>
                        <p className = "" >address: {address}</p>
                    </div>
                    <div id="form" className="absolute p-10 transform -translate-x-1/2 -translate-y-1/2 border-2 rounded-md shadow-lg top-1/3 left-1/2 ">
                        <h2 className='flex p-5 text-2xl font-semibold' > Link Username </h2>
                        <form id='' className="">
                            <input id='username' className="m-5 border-2 rounded outline-0 focus:bg-slate-100 hover:bg-slate-50" type='text' value={userName} onChange={(event) => setUsername(event.target.value)} 
                            required minLength='3' maxLength='30' pattern="[a-zA-Z0-9_]+" title='only letters, numbers, and underscores.'/>
                            <button className='p-1 rounded hover:bg-slate-100 actve:bg-slate-200' type="submit" onClick={(e) => writeUserData( address, userName)}>Link Name</button>
                        </form>
                    </div>
                </>
            );

        
}

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