Textbox/Textarea, value to msg.payload

Hi all,

I have read some forums thru the NR forum, also in google. But I have not answer to my problem.
Here I have a template node, where is situated textbox from DIV (to edit huge text from DB). But I am not able to pass it to msg.payload out to saving edited text.

<div id="mylog" ng-bind="msg.payload" contenteditable="true">
</div>
<script>
(function($scope) {
$scope.send({"payload": (document.getElementById("mylog"))});

})(scope);
</script>

If you have any knowledge, please help me with this. Also is possible to use TEXTAREA.
Thanks a lot.

A simple example using ng-model to send the new value.
The text is sent using ng-blur, when focus is removed from textarea
Example flow.

[{"id":"b27417c585ab35ad","type":"inject","z":"c31640d81bf733c7","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"some text","payloadType":"str","x":100,"y":240,"wires":[["6b78b0928f5889d2"]]},{"id":"6b78b0928f5889d2","type":"ui_template","z":"c31640d81bf733c7","group":"4f791fdc1745d3d9","name":"","order":2,"width":0,"height":0,"format":"<textarea ng-model=\"myTextarea\" \nng-value=\"msg.payload\" \nng-blur=\"send({payload: (myTextarea || msg.payload)})\"/>\n\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":true,"templateScope":"local","className":"","x":120,"y":300,"wires":[["87a839e058b4c1f5"]]},{"id":"87a839e058b4c1f5","type":"debug","z":"c31640d81bf733c7","name":"debug 346","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":310,"y":300,"wires":[]},{"id":"4f791fdc1745d3d9","type":"ui_group","name":"micro","tab":"c954274bbed7292e","order":1,"disp":false,"width":"18","collapse":false,"className":""},{"id":"c954274bbed7292e","type":"ui_tab","name":"Solar","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
<textarea ng-model="myTextarea" 
ng-value="msg.payload" 
ng-blur="send({payload: (myTextarea || msg.payload)})">
</textarea>

Big thank. This is, what I search half day.
Running wel. Thanks .

2 posts were merged into an existing topic: Multi-lines text-input area

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