Submit html form by selecting radio button without using a submit button

I have a flow which gives me 6 options in the form of radio buttons to chose from and sends selected payload upon clicking the SUBMIT button.
what i need is the submit to happen on just selecting an option among the radio button, that is it should execute without clicking the submit button. .

how do i acheive that ?

[{"id":"5cc1176ba37a330e","type":"ui_template","z":"5b623fd31ca86a42","group":"422c63c25531cb58","name":"CHOSE MACHINE","order":1,"width":"30","height":"2","format":"<form ng-submit=\"send({payload: mymodel})\">\n<table width = \"100%\">\n<tr>\n<td><input type=\"submit\" value=\"Submit\"></td>\n<td>        <input type=\"radio\" id=\"mc0\" name=\"mc\" value=\"MC0\" ng-model=\"mymodel.select\"><label for=\"mc1\">MC0</label> </td>\n<td>        <input type=\"radio\" id=\"mc1\" name=\"mc\" value=\"MC1\" ng-model=\"mymodel.select\"><label for=\"mc2\">MC1</label> </td>\n<td>        <input type=\"radio\" id=\"mc2\" name=\"mc\" value=\"MC2\" ng-model=\"mymodel.select\"><label for=\"mc3\">MC2</label> </td>\n<td>        <input type=\"radio\" id=\"mc3\" name=\"mc\" value=\"MC3\" ng-model=\"mymodel.select\"><label for=\"mc3\">MC3</label> </td>\n<td>        <input type=\"radio\" id=\"mc4\" name=\"mc\" value=\"MC4\" ng-model=\"mymodel.select\"><label for=\"mc3\">MC4</label> </td>\n<td>        <input type=\"radio\" id=\"mc5\" name=\"mc\" value=\"MC5\" ng-model=\"mymodel.select\"><label for=\"mc3\">MC5</label> </td>\n</tr>\n</table>\n    </form>","storeOutMessages":true,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","className":"","x":1235,"y":275,"wires":[["6738ab4a14842435","795c194bbd4f50de"]]},{"id":"6738ab4a14842435","type":"debug","z":"5b623fd31ca86a42","name":"debug 2632","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1455,"y":275,"wires":[]},{"id":"8e8f6bdd4e0dc010","type":"ui_toast","z":"5b623fd31ca86a42","position":"dialog","displayTime":"3","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1365,"y":375,"wires":[[]]},{"id":"795c194bbd4f50de","type":"change","z":"5b623fd31ca86a42","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"You have selected","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.select","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1300,"y":325,"wires":[["8e8f6bdd4e0dc010"]]},{"id":"422c63c25531cb58","type":"ui_group","name":"TABLE","tab":"5e0dd10e66fdea95","order":1,"disp":false,"width":"30","collapse":false,"className":""},{"id":"5e0dd10e66fdea95","type":"ui_tab","name":"TEST","icon":"dashboard","order":8,"disabled":false,"hidden":false}]

submit

you can use ng-click

<form>
<table width = "100%">
<tr>
<td>        <label><input ng-click="send({payload: 'mc0'})" type="radio" id="mc0" name="mc" value="MC0">MC0</label> </td>
<td>        <input type="radio" id="mc1" name="mc" value="MC1" ng-model="mymodel.select"><label for="mc2">MC1</label> </td>
<td>        <input type="radio" id="mc2" name="mc" value="MC2" ng-model="mymodel.select"><label for="mc3">MC2</label> </td>
<td>        <input type="radio" id="mc3" name="mc" value="MC3" ng-model="mymodel.select"><label for="mc3">MC3</label> </td>
<td>        <input type="radio" id="mc4" name="mc" value="MC4" ng-model="mymodel.select"><label for="mc3">MC4</label> </td>
<td>        <input type="radio" id="mc5" name="mc" value="MC5" ng-model="mymodel.select"><label for="mc3">MC5</label> </td>
</tr>
</table>
    </form>
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.