I have a form like poll form.When there is no data in db I want to show only add button and when user clicks "more" I want to show him/her a submit button. I used the following code but it seems doesn't works.
if ($form['count']['#value'] > 0) {
$form['submit'] = array(
'#t开发者_如何学Cype' => 'submit',
'#value' => t('Submit')
);
}
How can I do this?
The values will be in $form_state['values'] so try:
if($form_state['values']['count'] > 0){....
I would expect that at this point the $form['count']['#value'] is not set.
精彩评论