How can the value of a button be processed so that when one of the three buttons is selected, the data is recorded in different tables?

There is such a form:

<form method="POST" action="/new"> <button type="button" name="name_1">Название_1</button> <button type="button" name="name_2">Название_2</button> <button type="button" name="name_3">Название_3</button> <select name="name_4"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <input type="text" name="name_5"> <button type="submit" value="save" name="submit">Сохранить</button> </form> 

I thought that you can solve everything with php, but they tell me that something from js is needed here.

  • one
    Are you sure that you need exactly three buttons , and not three radiobuttons (or something else)? - Dmitriy Simushev
  • Without processing on php in any way - korytoff
  • The fact that no php in any way, I understand that perfectly. And I use buttons because of the design. Radio buttons are hard to customize, but you can try playing with the label ... - X0TTA6bI4
  • So you want to imitate radio buttons with these buttons? - tutankhamun
  • Found a solution. Thanks to Dmitriy Simushev for the hint. Used radiobutton. Hid the input and played with the label, in the end got what I wanted. - X0TTA6bI4

0