I have a form with input fields such as this one:
'sex' => array(
'#type' => 'radios',
'#title' => t('Sex'),
'#options' => array('m' => t('M'), 'f' => t('F')),
'#description' => t("We use this to write Mr. or Mrs. in the letters we send you.")
)
By default, this prints the label first ('Sex'), then the radio buttons, and then the description. I would like to print out the label followed immediately by the description and have the radio buttons appear last. How can I achieve this? I know how to load a stylesheet, but in this case it would be nice for the html to appear in the correct order: <label /><div class="description" /><input />
rather than <label /><input /><div class="description" />
Edit: The solution proposed by Anil Sagar works, but introduces a bug. Indeed, what I use his solution, it prevents me from giving a description to a checkbox field. In other words, if I write
$form['myCheckbox'] = array(
'#type' => 'checkbox',
'#title' => t('My checkbox'),
'#description' => t("My description")
);
that description never makes it to the HTML. Does anyone know how to fix this?