Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

226
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda