Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!