ID #11 (Previous | Next)

POST request to:

Ending URL: http://www.candidity.co.uk/drupal/tb_sirate/form-test/select

Fields: `<?php array (
'select' => 'one',
'select_required' => 'one',
'select_optional' => 'one',
'empty_value' => 'one',
'empty_value_one' => 'one',
'no_default' => '',
'no_default_optional' => 'one',
'no_default_optional_empty_value' => '',
'no_default_empty_option' => '',
'no_default_empty_option_optional' => '',
'no_default_empty_value' => '0',
'no_default_empty_value_one' => 'one',
'no_default_empty_value_optional' => '0',
'multiple[0]' => 'two',
'op' => 'Submit',
'form_build_id' => 'form-UccODAJ7CEz7MEJgOF-lRGZRChCfu-gBsAEjO3D9620',
'form_id' => 'form_test_select',
)`

Skip to main content

## Error message

- No #default_value, #required field is required.
- No #default_value, #required, #empty_option field is required.
- No #default_value, #required, #empty_value 0 field is required.
- No #default_value, #required, #empty_value one field is required.
- #multiple, #required, no #default_value field is required.

# Select

#default_value one
#default_value one, #required *
#default_value one, not #required
#default_value one, #required, #empty_value 0 *
#default_value = #empty_value, #required *
No #default_value, #required *
No #default_value, not #required
Should result in "one", because it is not required and there is no #empty_value requested, so default browser behavior of preselecting first option is in effect.
No #default_value, not #required, #empty_value empty string
Should result in an empty string (due to #empty_value), because it is optional.
No #default_value, #required, #empty_option *
No #default_value, not #required, #empty_option
Should result in an empty string (default of #empty_value), because it is optional.
No #default_value, #required, #empty_value 0 *
Should never result in 0.
No #default_value, #required, #empty_value one *
A mistakenly assigned #empty_value contained in #options should not be valid.
No #default_value, not #required, #empty_value 0
Should result in 0, because it is optional.
#multiple, #default_value two
#multiple, no #default_value
#multiple, #required, no #default_value *