Jump to content

is there a way to make "size" work on "number" input


NewDLR

Recommended Posts

Hi,

 

I want to restrict the field to 3 spaces for a "number" input  like this

 

<input type="number" name="10" min="0" step="1" max="45" size ="3">

 

It works with type="text", but I cannot seem to get it to work for type="number"

 

Is there a solution to this?

 

Many thanks

If you're setting a max of 45, the field is only going to have at most 2 digits in it. Why try to allow 3 when 2 is going to happen? If you're worried about browsers that don't support a number form field, add that check to your javascript validation when the form is submitted.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.