How to make a decimal with comma instead dot for input number in html5 in Microsoft Edge

Viewed 844

I would like a that accept comma instead of dot

Using a validator like below works in chrome but not in edge :

<input type="number" pattern="[0-9]+([\,|\.][0-9]+)?" name="my-num"
    step="0.01"
    id="with-validator"/>

$('#with-validator').on('change keyup', function(event) {
    if ( event.target.validity.valid ) {
        $('#result').text($(this).val());
    } else {
        $('#result').text('NOPE');
    }    
});

Unfortunately I am working on a UWP windows 10 app that use the Edge render engine.

How could I achieve this in Edge?

1 Answers
<input type="number" name="quantity" min=".01" max=".99" step= ".01"/>

This is a simpler way to right the regex expression, but as to your actual issue...

http://quirksmode.org/html5/inputs/ States that Edge only offers 3 4 and 5 out of this list This type is supported if the browser 1.Offers the user a customised interface (custom keyboard on touchscreen; arrows on desktop) 2.Restricts input to numbers (and related characters such as a negative sign) 3.Does not send incorrect data to the server 4.Halts form submission upon finding incorrect data 5.Informs the user of a failed submission with an error message

in a nutshell the HTML5 input number is not 100 percent supported by the edge browser

Related