I have a custom button to save and redirect node to a custom page to preview. The content type has paragraph fields embedded. If any validation error occurs in paragraph fields, my custom button is not rendering when the node form showing error. After refreshing the page, it is appearing in the node form. Can anyone help me? This is the form_alter code and custom submit handler.
function mymodule_form_alter(&$form, &$form_state, $form_id){
if($form_id == 'form_id') {
$link = "link";
$form['previewbtn'] = array(
'#type' => 'button',
'#value' => t('Preview'),
'#weight' => 9,
'#submit' => array('custom_submit'),
'#name' => 'preview_btn',
'#executes_submit_callback' => TRUE,
);
function custom_submit($form, &$form_state) {
$node = node_form_submit_build_node($form, $form_state);
node_save($node);
$link = "link";
$form_state['redirect'] = $link;
unset($_GET['destination']);
drupal_static_reset('drupal_get_destination');
drupal_redirect_form($form_state);
}