I want to add custom input type button in form. I tried following code, but it is converting it to submit type button. How can i add input type button ?
$form[custom_button] = array('#type' => 'button','#value' => t('Test Button'),);
I want to add custom input type button in form. I tried following code, but it is converting it to submit type button. How can i add input type button ?
$form[custom_button] = array('#type' => 'button','#value' => t('Test Button'),);
It's not converting it to a submit button type, they are different
Form items of type "button" will trigger the form submission but won't trigger the hook_form_submits like a form item of type "submit" does. It's eseentially a blank button apart from hook_validate is called but in there you can do whatever special functionality your button is supposed to do