/    Sign up×
Community /Pin to ProfileBookmark

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′ />[/CODE]

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…

[url]http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_input_type_number[/url]

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@rtretheweyApr 13.2013 — The code you posted is OK, so it's something else. Are you using an HTML 5 <!DOCTYPE>?
Copy linkTweet thisAlerts:
@cootheadApr 13.2013 — Hi there KarneeKarnay,

browsers supporting...

[indent][color=navy]

input type="number"

[/color]
[/indent]


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

Of course, it is still only classified as "[i]Working Draft[/i]". ?

[b]Source[/b]:-
[list]
  • [*][url=http://caniuse.com/#feat=input-number]Support for input type="number"[/url]
  • [/list]


    [i]coothead[/i]
    Copy linkTweet thisAlerts:
    @KarneeKarnayauthorApr 13.2013 — Thanks guys. Don't know what was happening, but quiting the compiler and restarting it seemed to fix it. :p
    Copy linkTweet thisAlerts:
    @jedaisoulApr 16.2013 — 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.
    ×

    Success!

    Help @KarneeKarnay spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.7,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...