I have the following input:
<input type="number" class="form-control custom-values" name="Width" id="item-b" min="1201" max="1500" value="1361">
I'm trying to make sure that the value input by the user is within the min max boundaries. However, I'm running into an odd issue.
When I use this script to check the values:
if($(this).val() > $(this).attr("max") || $(this).val() < $(this).attr("min")){
alert("out of bounds");
all_custom_sizes_valid = false;
}else if($(this).val() < $(this).attr("max") || $(this).val() > $(this).attr("min")){
if(!all_custom_sizes_valid){
alert("fixed to in bounds");
all_custom_sizes_valid = true;
}else{
alert("in bounds");
}
}
Things generally work fine.
However, when I input 150 into the input box, it gives me an alert that the value is within bounds. 150 is the only number I've been able to find that does this.
I've also had other issues with the validation not updating properly when I change back to a valid value and the "Fixed to in bounds" alert not popping up.
Any insight would be greatly appreciated.