Hi all!
I need count the quantity of characters left in Input Text using a JavaScript code. In this case I won't any component like Character Count. Just via JavaScript.
How to count characters left of input text using event onkeyup or another event?
Thanks!!!
Best regards!
Frampton
Frampton Fossi wrote:
Now, see my OML...
Hi Frampton,
I did some code changes in the shared .oml file... Please find the attached .oml solution file
Hope this helps you!
Regards,
Benjith Sam
Hi,
Try using the below solution:
http://www.mattmorgante.com/technology/textarea-remaining-characters-javascript
Mahesh Manchala wrote:
Hi, Mahesh!
I see that script don't read or get the length (max limit) of Input Text. I need too get the length of Input Text via code...
How to implement this in Service Studio?
Thanks!
For the mentioned use-case, you can use the CharacterCount Widget available in OutSystemsUIWeb Module
Set the IsDescending property to True value
Benjith Sam wrote:
Hi, Benjith Sam!
I need that solution don't use any components. Needs to be via code! I need too get the length of Input Text via code...
Thank you!
Why? The component is also just code. With the benefit of it already been tested.
Daniël Kuhlmann wrote:
Hi, Daniel!
I'm a novice OutSystems MasterClass of Rafael Pereira, and I want understand how works the additional codes at Service Studio. We are challenged by others friend to solve this problem without components... Just this!
:-)
I have created a sample reactive application and used the below mentioned JS code.
see this sample app
JS Code
var inputMaxlengthValue = document.getElementById($parameters.InputElementId).getAttribute('maxlength'); var inputTextLength = document.getElementById($parameters.InputElementId).value.length; $parameters.RemainingCharacterCount = inputMaxlengthValue - inputTextLength;
Hi, Benjith!
Let me show to you an error occurried with app...
Thank you so much, Benjith! It's works now !
Best regards, friend!
You are most welcome, Frampton :)
Glad I could be of help :)