Multiple forms per page HTML page for yourself

I need to have several forms on the same web page, they are all POSTing for themselves, and then perform different actions depending on the type of form.

What is the best way to achieve this?

To be more specific, the page displays information about the event with a subscription form (drop-down list) and another form for each of the subscribers, which allows them to unsubscribe (this is just a button).

+3
source share
2 answers

A few ideas for you:

  • Hidden field in every form

    <input type="hidden" name="formname" value="firstForm" />

  • Or set the action url to enable the request

    <form action="mypage.php?formtype=firstForm" ...>

  • Named buttons to let you know what was pressed.

    <input type="submit" name="firstForm" value="Submit" /> And then check that firstForm (et al) was returned

: SO HTML. (), , (, , , !)

+9

, formid. , , , .

?

0

Source: https://habr.com/ru/post/1698187/


All Articles