'Bad value number for attribute value on element input

I am getting this error "Bad value number for attribute value on element input: Expected a minus sign or a digit but saw n instead" for this HTML code <label for='Card_Number'>Card Number:</label> <input type='number' id='Card_Number' name='Input_card_number' value='number' placeholder='0000-0000-0000-0000'>. Please how do i go about this?



Solution 1:[1]

You have an input with type=number but then you set the value to a string, here: value=number. I believe what you want to do is:

<label ...>...</label>
<input type='text' id'Card_Number' ... placeholder='0000-0000-0000-0000' />

and then think about using pattern or have type number, but then no - in your input

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex