The attached Node Red Flow with the attached HTML and Javascript Code is working as follows:
- msg.payload sending from the buttons is displayed in the textarea and can also be send out correct to the debug node
- I also can change the content of the textarea and then send out correct to the debug node
But after I have changed the content of the textarea, all further msg.payload inputs from the Buttons are ignored until I make re deployment of Node Red.
<textarea name="textentered" id="textentered" rows="8" cols="25">{{msg.payload}}</textarea>
<input type="submit" value="Save Comments" ng-click="send({payload:test()})">
<script>
(function(scope) {
scope.test = function() {
var text = document.getElementById("textentered").value;
alert(text);
return "E:"+text;
}
})(scope)
</script>
I have made several modification but never could fix this problem. So I hope somebody in this community can help me.
[{"id":"284cd852.c67658","type":"tab","label":"Test Textarea","disabled":false,"info":""},{"id":"8e7a3e8e.4c077","type":"ui_button","z":"284cd852.c67658","name":"Input \"Test Text\"","group":"67a39dee.c646e4","order":1,"width":"3","height":"1","passthru":false,"label":"Test Text","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"TestText","payloadType":"str","topic":"","topicType":"str","x":210,"y":320,"wires":[["2eff8061.69559"]]},{"id":"fae42a25.a6e348","type":"ui_button","z":"284cd852.c67658","name":"Input \"\"","group":"67a39dee.c646e4","order":2,"width":"3","height":"1","passthru":false,"label":"^^","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":" ","payloadType":"str","topic":"","topicType":"str","x":180,"y":380,"wires":[["2eff8061.69559"]]},{"id":"53d4f9b7.899c88","type":"debug","z":"284cd852.c67658","name":"Content of textarea","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":710,"y":380,"wires":[]},{"id":"2eff8061.69559","type":"ui_template","z":"284cd852.c67658","group":"67a39dee.c646e4","name":"Textarea","order":3,"width":"0","height":"0","format":" <textarea name=\"textentered\" id=\"textentered\" rows=\"8\" cols=\"25\">{{msg.payload}}</textarea>\n <input type=\"submit\" value=\"Save Comments\" ng-click=\"send({payload:test()})\">\n \n<script>\n\n(function(scope) {\n\n scope.test = function() {\n \n var text = document.getElementById(\"textentered\").value;\n alert(text);\n return \"E:\"+text;\n }\n\n \n})(scope)\n\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":500,"y":380,"wires":[["53d4f9b7.899c88"]]},{"id":"67a39dee.c646e4","type":"ui_group","name":"Date Range","tab":"660a703d.ea902","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"660a703d.ea902","type":"ui_tab","name":"Test Multiline Input","icon":"fa-bar-chart","order":4,"disabled":false,"hidden":false}]