I have a drupal proyect inside another page as an iframe
and I want to add an attribute to the login submit button that redirect the top url to an custom url like this:
top.location.href = 'somepage.html';
I'm trying this:
function hook_form_alter(&$form, &$form_state, $form_id){
if($form_id == 'user_login_block'){
$form['actions']['submit']['#attributes'] = array('onclick' => "top.location.href = 'somepage.html';");
}
}
I'm sure that the $form_id
is user_login_form
, but nothing happened.