Closed (fixed)
Project:
Extra Fields Checkout Pane
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
18 Aug 2011 at 22:50 UTC
Updated:
8 Oct 2011 at 12:21 UTC
Hi, I have a number of mandatory custom order fields, each using a list of manually entered options (safe_key|Some readable option per line).
When these are displayed to the user they each default to the first value in the list. Is it possible to initially default to something like "Please select" instead and whilst in this state the field would fail the mandatory check.
Hopefully the reason for this is clear, it is to make the user select from the list, rather than inadvertently picking up the default.
This module is great BTW. Its just what we needed. Many thanks.
Tim
Comments
Comment #1
megachrizYes, this is already possible, but it's not really self-explanatory how to do that. What you needed to do is give the first item in the list an empty key.
Here is it how it goes for standard selection fields:
In this case the key of the first item is just a single space.
And here is it how it goes for PHP selection fields:
In this case the key of the first item is an empty string.
I hope that this clears things up. If so, I will add it to the README-file.
Comment #2
timtunbridge commentedThat's fantastic! I tried something similar but was missing the space in the first part of the key. Now its working perfectly.
Great support thanks.
Comment #3
timtunbridge commentedComment #4
megachrizSetting status to "Needs work" for me, explanations posted in #1 should be added to the README file.
Comment #5
megachrizI have added documentation about the field types in the README.txt. I've also added an implementation of hook_help() to the module, so the documentation can be reached from within the website as well (+ the documentation is translatable). I've also added validation to the form: if you now add a select field and you make the field required, but you have no empty option in the list, the module will display a warning. You are able to proceed and ignore the warning though (you could have specific reasons for to not include an empty option).