Closed (fixed)
Project:
Forms (obsolete)
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Apr 2007 at 22:12 UTC
Updated:
22 Mar 2008 at 06:52 UTC
If i use the following for definition of radios field: 0:NO;1:YES and set the field to required.
when i view the survey i have the NO case pre-selected.. which is odd; but acceptable.. but if i submit with this case, it fails validation.
unfortunate i guess that the survey module couldnt use cck as its form builder as it is much more supported, tested and feature rich.. but i guess overkill for surveys??? but maybe could use a subset of their fields??
Comments
Comment #1
liquidcms commentedok, i think i have the solution.. but not sure why the code was written like this???
the forms module validates fields on its own.. like radio buttons.. but the code that is used, specifically this:
is wrong!!
Radio buttons can have a valid selection of "0".
The part that is more odd though is that this function exists at all.. the forms module is using (as it should) the forms api; which already does the checks... and it does them correctly... you can see the code runs through both.. it first does the std forms api check.. which passes in my example (as it should) but then runs the forms module check (which is coded wrong and which fails)... but i simply commented out the form_set_error and error = true lines above and things seem to work correctly now... i.e. if i have radios that dont get a default (which for incorrectly is anytime i dont have a value of 0 as an option) and i submit.. the form fails (from std forms api check).. and if i submit a value of 0.. it passes; as it should.
Comment #2
quicksketchForms and survey modules are no longer being maintained, use Webform module instead.
---Closing down issue queue of survey module---