<!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>
1.my input box minimum value is zero and 'step any' will allow decimal too
*if i enter '.2' it allows it takes minimum value 0 if i enter 0.2 it takes as 0.2
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'
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