valan Posted October 3, 2013 Posted October 3, 2013 Privet! I've just found that if you create integer field with minimal allowed value 0 (zero), then it doesn't save it. As a result, input accepts negative values even with HTML5 input type. Is it a bug or feature?
BUCKHORN Posted October 8, 2013 Posted October 8, 2013 Where are you setting the min in the html5 tag or is there a setting in the fieldtype?
valan Posted October 8, 2013 Author Posted October 8, 2013 Hi! I'm setting it in field admin (e.g. Setup->Fields->myIntegerField->Input->Minimum value).
BUCKHORN Posted October 8, 2013 Posted October 8, 2013 hmm, sounds like a bug, because zero is an integer. a workaround may be to leave the min blank in the fieldtype and use min="0" in the html5 tag in your template. <input type="number" name="quantity" min="0">
valan Posted October 8, 2013 Author Posted October 8, 2013 dharmanerd, thanks! It works for own templates but doesn't work in page admin frontend. Perhaps Rayan should look at it. Thanks!
BUCKHORN Posted October 8, 2013 Posted October 8, 2013 yep, I didn't think about that and my workaround doesn't do you any good in this case. I had a look at the module and this is by design, but I don't think Ryan had considered the case where you may want a zero, but not negative numbers. I think it needs to be submitted as a bug. In the meantime, try commenting line 30 in wire/core/modules/InputField/InputfieldInteger.module and let me know if that works. 1
Soma Posted October 8, 2013 Posted October 8, 2013 Minor correction: it's wire/modules/InputField/InputfieldInteger.module
teppo Posted October 10, 2013 Posted October 10, 2013 I've had reporting this issue on my todo-list for a while.. current behavior is obviously a bit off, as there are quite a few situations where you want to allow positive numbers or a zero
BUCKHORN Posted October 10, 2013 Posted October 10, 2013 I'll report it and submit a patch when I get a chance. How do we report bugs? Git?
apeisa Posted October 10, 2013 Posted October 10, 2013 GitHub is great way to go. Forum is fine too, specially when you are not sure if it's a bug or not (so more people looks for it and maybe tries to reproduce).
BUCKHORN Posted October 10, 2013 Posted October 10, 2013 Thanks Apeisa. Issue logged in Git. https://github.com/ryancramerdesign/ProcessWire/issues/257 1
lenoir Posted September 3, 2018 Posted September 3, 2018 Hi, On GitHub it's posted as solved, although I still get that problem with integer fields on Form Builder. Anybody still having that problem?
cstevensjr Posted September 11, 2018 Posted September 11, 2018 On 9/3/2018 at 4:16 AM, lenoir said: Hi, On GitHub it's posted as solved, although I still get that problem with integer fields on Form Builder. Anybody still having that problem? Bring up your Form Builder related issue in the Form Builder VIP Forum
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now