|
|
Joined: Feb 2007
Posts: 57
journeyman
|
journeyman
Joined: Feb 2007
Posts: 57 |
When editing My Profile, and a user types the number 0 into a required custom field, submitting the form returns a UBB Error:
<fieldname>is a required field
For example:
# of petsis a required field
Note that there is also no space between the name of the field, and the word 'is'.
Last edited by Rick; 05/30/2007 4:54 PM.
RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
Which field are they marking with a 0?
|
|
|
|
Joined: Feb 2007
Posts: 57
journeyman
|
journeyman
Joined: Feb 2007
Posts: 57 |
The first custom field, which is set as required.
RnJpZW5kc2hpcCB3aXRoIHRoZSB3b3JsZCBpcyBob3N0aWxpdH kgdG93YXJkcyBHb2QuICBKYW1lcyA0OjQ=
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
php treats 0 as basically empty/null. So when it's required and we check if it has a value, 0 is being treated as no value, so it thinks the field isn't filled in. I'll need to change some code to make it look for a value or 0 explicitly.
|
|
|
|
Joined: Jun 2006
Posts: 16,299 Likes: 116
|
Joined: Jun 2006
Posts: 16,299 Likes: 116 |
Yeh thats what I had figured; with most things if you treat it as a varchar it'll allow a 0 though, eventhough it is a number which would generally be forced as an int; so it'd interesting that it still treats it as a 0 since i think those are treated as a varchar
|
|
|
|
Joined: Jun 2006
Posts: 9,242 Likes: 1
Former Developer
|
Former Developer
Joined: Jun 2006
Posts: 9,242 Likes: 1 |
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
0 members (),
686
guests, and
131
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|
|