Dummy default value for nodereference select list
threexk - May 26, 2008 - 06:46
| Project: | Content Construction Kit (CCK) |
| Version: | 6.x-2.x-dev |
| Component: | optionwidgets.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
If a nodereference select list is required and default value is set to <None>, the default will actually be the first node in the list. This makes it too easy for a user to submit the form without actually selecting from the select list.
Proposed solution:
Allow dummy text to be set as the default value for a select list. e.g., "- Select -" or "" or just blank. If the form is submitted with this value selected, validation fails if the field is required. This text would be specified through the default value section within the nodereference select list configuration page.
(This issue may be similar to existing issue http://drupal.org/node/167809.)

#1
I second this (Except on D6). Spent the last two hours trying to find a solution... I dont want to dive into the module code unless I have to.
#2
That's actually a request for optionwidgets.
Moving to D6 branch, this is where development happens.
#3
Is there any news on this?
#4
Hi, any news on it?
I do have same problem.
if a field with dropdown list is required only the allowed values are showen and the default value is set to the first in the list. but there should be a value visible but not allowed to used for submitting.
the list of available values should be different (x+1) to allowed values (x)
if i do that by a simple list in allowed values i use "|" which can't be submitted. but if i use PHP code I can't get "|" on the begin of the array.
is there any help?
Thx in advance
HoKe
updated
this was helpful for me. i got i working. i updated the includes/form.inc
http://drupal.org/node/206844#comment-1997930
#5
Look at this http://drupal.org/node/206844
There is some code for 5.x there, still working on 6.x
#6
I was getting the same problem. here is the problem that I had
Module - nodereference
when - select list is single select and required the first value in the list was selected by default
Here tweaks I did to solve this issue - see patch file below