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

225
Visualizações
html input box minimum and decimal values

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>

</style>
</head>
<body>

<input  id="stockiboundqty0"  min=0 oninput="validity.valid||(value='');" step="any"  autocomplete="off" type="number" placeholder="Enter Quantity"/>
<button onclick="alertdialog()">submit</button>
<script>
function alertdialog()
{
alert(document.getElementById("stockiboundqty0").value);
}
</script>
</body>
</html>

what do i have

1.my input box minimum value is zero and 'step any' will allow decimal too

problem

*if i enter '.2' it allows it takes minimum value 0 if i enter 0.2 it takes as 0.2

what do i needed

1.i need to let user enter .2 and takes value as 0.2 with the input box minimum 'value=0' and with step 'any'

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Remove the oninput handler. That is preventing you from using a leading decimal point.

<input 
  id="stockiboundqty0" 
  min=0 
  step="0.1" 
  autocomplete="off" 
  type="number" 
  placeholder="Enter Quantity"
/>

<!DOCTYPE html>
<html>
<body>
<input 
  id="stockiboundqty0"
  min=0
  step="0.1"
  autocomplete="off"
  type="number"
  placeholder="Enter Quantity"
 />
</body>
</html>

should work

about 4 years ago · Juan Pablo Isaza Relatório
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