It would be very useful to be able to set the minimum and maximum value for integer, decimal and date field with variable or global variable instead of fix value
2 Likes
I know that I can do it with css and jquery and use onValidate to do it
ex. for longitude and latitude
?>
<style>
/*Remove up/down arrow if needed*/
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance:textfield;
}
/*Change background-color and/or border if needed*/
input:in-range {
/*background-color: rgba(0, 255, 0, 0.25);*/
}
input:out-of-range {
background-color: rgba(255, 0, 0, 0.25);
border: 3px solid red;
}
</style>
<script>
$(document).ready(function() {
$("#id_sc_field_longitude").attr({"max":180,"min":-180,"step":0.000001}).prop("type", "number");
$("#id_sc_field_latitude").attr({"max":90,"min":-90,"step":0.000001}).prop("type", "number");
});
</script>
<?php
Also verify the result in onValidate
This is definitely a very valuable suggestion but suggestions sent to SC will never be considered even if you wait for years. I have been waiting for years to implement a local language I have sent all the required information few years back and not even a single response from SC Suggestions Team even after many follow ups. If you approach support team they will simply direct us please contact suggestions. There is no collaboration between them. I dont think SC ever values their Customers.
1 Like