Last modified: 2011-12-12 05:22:13 UTC
Consider a field that lets a user set a value based on category Wiki Page: {{{field|Homepage|autocomplete on category=Wiki Page}}} Today, this field specification will allow the user to save a value that does not exist. I propose that the field be defined so that the final value is limited to existing values. For example, {{{field|Homepage|autocomplete on category=Wiki Page|mustexist}}} The user could still type in a non-existing page, since it's a combobox. Existence is verified after the user hits "Save page". If the value does not exist within the specified set (category=Wiki Page above), an error message displays and the form stays open. This behavior would match that of a mandatory string field that is empty on "Save page".
Ignore previous description, see new subject line.
This feature has been added to SF in version 2.1, with the new "existing values only" parameter.
Reopened. I just tested this feature with Semantic Forms 2.2.1 and 2.3.1 and it is only partially working, just barely. The only time it works that I was able to find is when focus changes. If the user immediately clicks the "Submit" button, or just hits the "Enter" key while focus is still in the field, any non-existing value can be submitted. I tested input types combobox and text with autocomplete, with both single values and multiple. It appears that this bug is being worked on already: http://wikimedia.7.n6.nabble.com/quot-one-to-many-quot-validation-td678004.html#a678006
Created attachment 9644 [details] one-to- many validation Fixed bug with focus; Added validation for fields with autocomplete;
I don't think the issues with the focus are cause enough to re-open this feature request - the basic functionality is now there. And note that it applies to the 'combobox' input, not any other input type. I'm resetting this to 'fixed'.
Reopened. There are no issues with the focus as far as I can tell. It appears to me that it works perfectly in all of my tests. The issue is that nothing else works, and the goal proposed in this report has definitively not been achieved: > The user could still type in a non-existing page, since it's a combobox. > Existence is verified after the user hits "Save page". If the value does not > exist within the specified set (category=Wiki Page above), an error message > displays and the form stays open. This behavior would match that of a > mandatory string field that is empty on "Save page". The combobox still will: * allow non-existing values to be saved. * no error message is displayed * the form does not remain open to allow the user to fix the error in the same manner as the behavior invoked by the "mandatory" parameter Although the focus feature is interesting, I think it should be removed. The focus feature will delete all of the data the user entered if there is a minor typographical error, with no opportunity to fix it. In the case where a user meticulously enters in some data, and then switches to another browser tab to check that the data is entered in correctly, it would be more than a little annoying for the user to come back to the form and see all of the data has been erased.
The idea that validation should be improved is a valid opinion, but nevertheless it belongs in a different feature request, if anywhere, since this feature already exist. Marking back to "fixed".
Fresh report: https://bugzilla.wikimedia.org/show_bug.cgi?id=32976