Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.