- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 05:28 AM
hi all,
I have input field (text area) in Widget.
<textarea rows="1" cols="50" ng-model="data.comment_input">
Requirement is to get input value in client Controller.
Below code is not working
console.log( "input value is : " + c.data.comment_input.value);
Please suggest.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 06:19 AM
Hi @Ujjwal1,
I replicated your code in my instance
HTML template:
<div>
<!-- your widget template -->
<textarea rows="1" cols="50" ng-model="data.comment_input">
</textarea>
</div>
Client side:
api.controller=function() {
/* widget controller */
var c = this;
console.log( "input value is : " + c.data.comment_input);
};
Server side:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.comment_input = "Dummy Value";
})();
and it's working, please review based on my inputs.
If my solution helped you, please hit the helpful button also do accept the solution if it serves the purpose.
Thanks,
Saurabh Dubey.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2024 06:19 AM
Hi @Ujjwal1,
I replicated your code in my instance
HTML template:
<div>
<!-- your widget template -->
<textarea rows="1" cols="50" ng-model="data.comment_input">
</textarea>
</div>
Client side:
api.controller=function() {
/* widget controller */
var c = this;
console.log( "input value is : " + c.data.comment_input);
};
Server side:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.comment_input = "Dummy Value";
})();
and it's working, please review based on my inputs.
If my solution helped you, please hit the helpful button also do accept the solution if it serves the purpose.
Thanks,
Saurabh Dubey.