/    Sign up×
Community /Pin to ProfileBookmark

Creating Form with INPUT TYPE

Hello. I am creating a form and it is working for Firefox and Internet Explorer (IE) browsers. But the input type does not work for Safari browser.

When I enter more than 10, it still went through and it is NOT suppose to go through is exceeding 10. It suppose to give the user a warning message [B]“You must enter a value between 1 and 10”[/B]. Anyone know why it does not work in Safari browser?

[CODE]<input type=”number” name=”quantity” min=”1″ max=”10″>[/CODE]

Thanks for any advice!

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@LandiaauthorAug 04.2015 — Below is a picture of the input number box I am working on:


[ATTACH]16781[/ATTACH]

In the Safari browser, if you use the UP and DOWN arrow, it will stop at 10, which is good. But if a user enter the number manually, like 300, it will process through. It should give the user a warning "You must enter a value between 1 and 10" but it does not.

I am wondering if there is another way to have a MIN and MAX input number box that will work for all browsers.

[canned-message]attachments-removed-during-migration[/canned-message]
Copy linkTweet thisAlerts:
@LandiaauthorAug 04.2015 — Alright, I found another way to make it work on all browsers by using the Select Option:

[CODE]<select type="number" name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
[/CODE]


Now my next issue is to let the users know that I am out of stock. I need an additional code to show users that this item is Out of Stock.
Copy linkTweet thisAlerts:
@suomyoneAug 08.2015 — Landia,

I find that your first code works fine when it's combined with the input type submit. For example,

[CODE]<form>
[INDENT]<input type="number" name="quantity" min="1" max="10">[/INDENT]
[INDENT]<input type="submit">[/INDENT]
</form>[/CODE]


Even though you can still manually enter 99, when you click on the submit button, it won't process.
Copy linkTweet thisAlerts:
@ZelnaAug 14.2015 — How about applying JavaScript to the code which will make sure that "out of stock" choice should not be selected in the first place?
×

Success!

Help @Landia 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.4,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...