Múltiples Eventos Submit en un solo formulario Drupal 7
En el siguiente articulo vamos a ver de manera sencilla como llamar varios métodos submit para varios botones que ejecutaran de manera sencilla.
Ejemplo
Como podemos ver una caja de texto con dos botones, en este caso lo importante es especificar la propiedad ‘#submit’ de la siguiente manera para su correcto funcionamiento.
$form['Text'] = array( '#type' => 'textfield', '#size' => 40, '#maxlength' => 40, );
$form['submit_1'] = array( '#type' => 'submit', '#name' => 'submit', '#value' => t('Submit 1'), '#attributes' => array( 'role' => array('button'), 'class' => array('btn btn-success'), ), '#submit' => array('send_submit'), );
$form['submit_2'] = array( '#type' => 'submit', '#name' => 'submit_2', '#value' => t('Submit 2'), '#attributes' => array( 'role' => array('button'), 'class' => array('btn btn-success'), ), '#submit' => array('send_all_submit'), );
Importante
Crear previamente los eventos submit en su archivo php.
Otras características de los formularios de drupal en: https://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7.x
3 comentarios
vvjlorg · diciembre 3, 2025 a las 8:05 pm
Yo, just checked out vvjlorg! Not gonna lie, things seem pretty solid. Layout’s clean, and it’s easy to navigate. Seems like a decent spot if you’re looking for something new. Check it out for yourself: vvjlorg
50betlogin · diciembre 19, 2025 a las 6:59 pm
Signed up for 50betlogin. The login process was straightforward, and the website is easy to navigate. Time to put my bets in. You should check them out here 50betlogin
rushbetbono · diciembre 19, 2025 a las 10:09 pm
Rushbetbono, manito, es la onda para encontrar esos bonos que te dan un empujoncito extra. Échale un ojo y aprovecha las promos! Dale click aquí rushbetbono.