www.webdeveloper.com
Results 1 to 5 of 5

Thread: input numbers only

  1. #1
    Join Date
    Mar 2013
    Posts
    61

    input numbers only

    I'm trying to build a sudoku game for a uni project and I've hit a snag with HTML input feilds.

    Code:
    <input class='span-2' type='number' min='0' max='9' />
    I need to create an input feild that takes a set of numbers btween 0 and 9. Only numbers and only thoes ones. The problem I have is that the text feild is created, but I can write stuff in them and go higher than 9. Any ideas?

    Also I got this from using this...

    http://www.w3schools.com/html/tryit....ut_type_number

  2. #2
    Join Date
    Mar 2011
    Posts
    1,137
    The code you posted is OK, so it's something else. Are you using an HTML 5 <!DOCTYPE>?
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Jan 2004
    Location
    chertsey, a small town s.w. of london, england.
    Posts
    1,460
    Hi there KarneeKarnay,

    browsers supporting...

    input type="number"


    ...appear appear to be rather thin on the ground, at present, with "Chrome" leading the field.

    Of course, it is still only classified as "Working Draft".

    Source:-


    coothead
    Last edited by coothead; 04-13-2013 at 10:05 AM. Reason: added source link

  4. #4
    Join Date
    Mar 2013
    Posts
    61
    Thanks guys. Don't know what was happening, but quiting the compiler and restarting it seemed to fix it.

  5. #5
    Join Date
    Mar 2012
    Posts
    1,396
    Sounds like the problem was caching. It amazes me how many times I get fooled by the browser not reading the updated page, because it has an old copy in cache.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles