add the same action for each button in javascript code example Example: two buttons in same form <input type="submit" name="button_1" value="Click me">