Skip to content

Mydata form : Selectbox for gender #1

@sarikas735

Description

@sarikas735

There is issue in populating the select box for gender, it shows the default value as 'Female' on edit page due to the miss match in closing the options array. Attaching the updated code.

$form['candidate_gender'] = array (
'#type' => 'select',
'#title' => ('Gender'),
'#options' => array(
'Female' => t('Female'),
'male' => t('Male')
),
'#default_value' => (isset($record['gender']) && $_GET['num']) ? $record['gender']:'',
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions