Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the HTML5 input type number be used with hexadecimal numbers?

Is there any way to make the HTML5 form input type "number" work with numbers in bases other than 10? For example, I would like to use the features of the number input type (up/down arrows, browser validation) with hexadecimal numbers.

like image 445
jonemo Avatar asked Jun 16 '13 10:06

jonemo


1 Answers

The W3C specs says that the number input value can only be a floating point number http://dev.w3.org/html5/markup/input.number.html#input.number.attrs.value , so the value is defined in here: http://dev.w3.org/html5/markup/datatypes.html#common.data.float If you'd like to have similar functionalities you can consider to use the jQuery UI spinner and check out this question for thoughts.

like image 146
Mimo Avatar answered Sep 21 '22 10:09

Mimo