Radio button set that sends message on actual radio button selection?

Radio button set that sends message on actual radio button selection? The existing, official radio button example, creates a radio button list, but the selection is not communicated back to NR until the associated button is clicked. Is there a way to avoid creating or using the button? That a message is generated as the actual radio button is selected, or clicked? Can an defined script action function call node.send? That would be one way to do it, right?

<div >
    <table>
        <tr>
            <td>
                <md-button ng-click="send({payload:mirror})">
                    Select
                </md-button>
            </td>
            <td>
                <ul>
                    <li ng-repeat="mirror in msg.payload track by $index" style="list-style-type: none;">
                        <label>
                            <input type="radio" ng-model="$parent.mirror" value="{{mirror}}" name="data" />{{mirror}}
                        </label>
                    </li>
                </ul>
            </td>            
        </tr>
    </table>
</div>

The above uses the button method to communicate the selected radio button, but I would like to remove the need for the button object. Tried the following, but I suspect I cut a corner and thus it is not working, don't seem to get a message back.

<script type="text/javascript">

    var theList = document.getElementById("List").getElementsByTagName('li');

    for (var i=0; i < theList.length; i++) {
        
        theList[i].addEventListener('click', Event, false);
    }

    function Event() {
        
        node.send( { payload: this.innerHTML } );
        
    }
</script>

<div >
    <table>
        <tr>
            <td>
                <md-button ng-click="send({payload:mirror})">
                    Select
                </md-button>
            </td>
            <td>
                <ul id="List">
                    <li ng-repeat="mirror in msg.payload track by $index" style="list-style-type: none;">
                        <label>
                            <input type="radio" ng-model="$parent.mirror" value="{{mirror}}" name="data" />{{mirror}}
                        </label>
                    </li>
                </ul>
            </td>            
        </tr>
    </table>
</div>

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