for input type=”number” how to set default value to 0

HTML attribute to set a default value is value:

<input type="number" value="1">

You’re setting this default value to null, and nothing (in HTML) can change it to zero (or anything else).
You must fix the value in your database, or in your template engine (something like {{model.PortNumber || 0}}).

At least, you can force your field to be filled with required attribute:

<input type="number" required value="">

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)