As I understand it you are building a HTML form and you want mobile browsers to display a numeric keyboard instead of the full one? The correct HTML syntax (check https://www.w3schools.com/html/html_form_input_types.asp) is:
Input Type Number The defines a numeric input
field. You can also set restrictions on what numbers are accepted. The
following example displays a numeric input field, where you can enter
a value from 1 to 5:
<form>
Quantity (between 1 and 5):
<input type="number" name="quantity" min="1" max="5">
</form>
Now if it were an Android form, you would put: android:inputType="numberDecimal" for example.
You said that you couldn't / didn't want to use the "number" instead of "text" attribute, but I really think that you should use attributes that are called for. Perhaps you could modify your code to accommodate the input fields with the "number" attribute or use jQuery to replace "text" with "number" on document ready.