If I create a required text field of the type Select list, the first alphabetical option is selected by default.

When the form is validated, this field will never trigger the warning "the field X is required", because there will always be a selected value

I'd like to configure the default option as something like a "[please choose from the list]" whose value is null. If user does not change the field, the form would not validate, and the warning "the field is X required" is shown.

How can I do this?

Comments

Caesar Tjalbo’s picture

You may want to check these posts, perhaps it'll help you:
http://drupal.org/node/71047
http://drupal.org/node/78024

karens’s picture

Title: Nothing selected as default behavior for Select Lists » Default to blank to force users to select option for required field
Component: text.module » optionwidgets.module
Category: support » feature

The fact that no blank option was displayed in list has been fixed since this issue was reported. The idea of having a required field display no option to force the user to select an option would be a feature request for the optionwidgets module. I'm moving this issue and re-naming it.

marcoBauli’s picture

This does not seem to be fixed yet in latest 4.7 CCK (4.7.x-1.3 Feb-01).

+1 for fixing, as this thing is quite nasty, personally i have to update loads of fields manually, and i'm never sure if the choice is voluntary, or if it's just the first choice coosen by the system...

any news about this apreciated! help testing offered

dopry’s picture

Status: Active » Closed (won't fix)

hopefully you worked around this or upgraded in the last year.