Mutiple buttons with different actions in a single HTML form

Опубликовано: 09 Апрель 2013
на канале: Jiansen Lu
18,925
61

Suppose in a HTML form with name search_form_results, we have three buttons.
One button requires action reports.php, while other two buttons require reportsD.php and reportsA.php. We can use JavaScript function to submit a form with different actions:
document.forms['search_form_results'].action = 'reportsA.php';
document.forms['search_form_results'].submit();
More about this code:
http://jiansenlu.blogspot.ca/2013/04/...