I tested the latest release on your Demo site - very impressive! When testing leaving a required field blank upon submission, I sometimes received the following message: "An illegal choice has been detected. Please contact the site administrator." The normal field required message appeared above this. What is reason for the illeagal choice message?

Comments

pivica’s picture

Component: Miscellaneous » Code
Category: support » bug

I tested the latest release on your Demo site - very impressive!

Thanks :)) and thanks again for your testing.

Just a short info about our future progress - we are now doing more testing of qforms pluggable architecture - actually we will release one more module on drupal.org qforms_extra that will hold additional form elements definitions (like number, markup text, date...). After that our plan is to not add any additional new big features in version 1.x - so in some 10-15 days I hope we will manage to release first alpha version of 1.x branch.

When testing leaving a required field blank upon submission, I sometimes received the following message: "An illegal choice has been detected. Please contact the site administrator." The normal field required message appeared above this. What is reason for the illeagal choice message?

This looks like a bug to me.

If you have that bug problem with a form http://demo.montenasoft.com/node/43 maybe I think I know what is a cause. That radio group "Radio buttons" is required but do not have default option selected - and if user tries to submit it without selecting some radio option form submit state will be invalid.

First for radio group in form builder we should use radio buttons and not check-box buttons because for radio group you can have only one default selection.
Second for required radio groups we should maybe require default radio option - so above problem would be avoided.

What do you think?

bwill’s picture

If the radio buton group has a default value, then that one would be already selected when the user accessed the form. So, what would happen if the radio button was required, but the user did not select one - they left the default selected because they either forgot to select one, or the default selection was the one they wanted? I'm guessing it would validate OK. If they forgot or didn't want to provide a value, then you don't get the benifit of making it a required field.

If the radio button group is not a required field, and not selected, what happens?

I think it would be better if possible, to not have any radio buttons selected as default when the user accesses the form.

That radio group "Radio buttons" is required but do not have default option selected - and if user tries to submit it without selecting some radio option form submit state will be invalid.

From your explanation, it sounds like a different type of error, but the cause is the same - the user did not select a radio button option that was defined as required.

bwill’s picture

Any comment on this? Can the message be changed to a regular entry required message? I'm about to put it on a dev site as a least step before deploying to production.

pivica’s picture

Hi bwill.

First and very very important do not use current dev release on your production site for now. Please check http://drupal.org/node/1087734 for current release plan.
We currently do not support updates until we stabilise code and database tables enough - today we will release new version whit additional improvements in core system but it will not be compatible with previous form definitions.

We are planing to release first 1.0-alpha1 by the end of this week probably which will be supported version, that would mean that no more additional changes should be introduced for 1.0 that would break already defined qform definitions and then from 1.0-beta1 we will also support upgrade paths (if we need to change something after all).

Any comment on this? Can the message be changed to a regular entry required message?

We are working on this right now - thinking about best solution and testing it - we should fix this before doing new release later today.

pivica’s picture

After further investigation I think that problem is not in qforms module but in Drupal core. Check http://drupal.org/node/919348#comment-4195320 and there you can also find proposed patch.

We are still working on next release, doing lot of testing, refactoring and finding some bugs - I hope today we will release new version.

pivica’s picture

Status: Active » Closed (duplicate)

New dev version is released - last before first alpha release.

Marking this issue as duplicate of http://drupal.org/node/919348