Is a switch selection not an event?

I have an html form containing a group of radio buttons.

When one of them is selected, the attribute of the form "action" must be executed, as well as the method "get".

But the problem is that the radio button selection is not recognized as an event!

and if I changed the radio buttons for sending, pressing the submit button would be recognized as an event and the action would take place, do you have any ideas why?

+3
source share
4 answers

HTML forms are not submitted unless someone clicks the submit button.

You can use Javascript to have your radio buttons submit the form:

<input type="radio" onclick="this.form.submit();" />

, , , , , . .

+2

. , javascript.

onclick="document.forms["myform"].submit();"
+2

onclick- , () . .

0

, html. javascript. , . , . "onSubmit". , submit .

0

All Articles