Is there any way to have this Countable plugin display the correct count when the page loads.
For example, if there are 200 words in a multiline input by default, when the page loads Countable is saying there are 0 words. As soon as you edit the input then Countable updates itself and displays the correct count.
Hope you can help as otherwise I’ll be lumbered with having to figure it out with regex
@ZeroqodeSupport is there a way to have an option for this plugin to include spaces in the character count? As well as custom modifications… for example:
If I have a tag {firstname} I want it to search my database to find the user’s first name and take that character count instead of displaying the count for {firstname} at 11 characters.
So let’s say the user’s name is John and he uses the tag {firstname} in a text box, I’d want it to count 4 characters instead of 11, because when the app is ran it will pull his first name from the database and count the characters in place of the tag. I know that’s possible through conditional formatting but the delay makes it almost not even worth doing. I’d love to learn to code this myself if you’re open to that also.
You can see from this image that I have included spaces to be accounted for as well as the actual length of text for a tag using the built in :numberofcharacters function as well as a regex count for \s but it doesn’t update in real time, there is a slight delay.
If you count the characters it would be 28 including spaces, but it shows only 25 because it automatically replaces the count for {FNAME} with the actual value that would be input into it (John).
So 7 characters for {FNAME} and 4 for John, there are 3 less characters represented in the total count because John is 3 characters smaller.
The same can be seen here where the first name is 9 rather than 7 characters and the count is then increased. by 2 overall from 28 to 30.
Hello there @laflash8, you are able to count all the characters in the input with help of plugin state “All”, as you can see in our demo it counts characters with spaces.
And regarding the name replace I suggest you set everything like here, this will be better solution. And everything will be fixed.
Thanks for the input, but due to the way I am planning to use this, it’s not really an option for me to use the search function for my users in the way that I want it to work.
I think I will just add a delay with a loading screen each time a tag is inserted to ensure that the proper length is accounted for.
@ZeroqodeSupport I am curious if there is any known issues with the plugin not capturing the count of an input when that input has it’s initial value set based on a conditional?
I have my input and countable element set up as below and it works fine normally:
We managed to push an update to this plugin. The problem was setting dynamic data for initial content and it was not seeing it.
Now, you can use plugin’s Get Countable Values action on page load event, but set the condition to check on your input element not to be empty, as this is an important note:
And it should run smoothly. Also refresh your page before giving it a try.
Thank you for the plugin! Works perfectly on one of my pages.
However, when I add the countable element to a reusable element on an input, it throws an error. Anyone seen this before and knows how to address this? @ZeroqodeSupport
Thank you for your answer! It actually didn’t work, but I ended up including a countable element on the page itself, which loads the library, and then the reusable countable elements were able to load without error.
However, now the counter itself is not reset when the popup closes and then reappears. Or when the input is dynamically populated in the popup the counter shows 0/150
I attempted to create the workflow the “Get countable values Countable A” but it didn’t solve the proble.
@yusaney1 thanks for suggestions! It might be a workaround because plugin indeed might not catch up to initialize on page load.
@mazorshimon we are not able to reproduce this error on our side, unfortunately:
But could you please share screenshots and/or screencast of your app with exact steps to reproduce it so we can try on our side and provide a better feedback on this matter. Also, the browser and OS version you are using and what you are trying to accomplish with this plugin.
However, if you want to solve this problem:
Just use plugin’s Get Countable Values action On Page Load event, with a single condition (mandatory!):
Sorry but what is your project idea and how exactly you are trying to use this plugin? Why would you need to place it into a Reusable Element, could you please explain a bit more on this matter so we can understand whether or not it is possible to use this plugin accordingly.
I am using a reusable element that holds a popup I have in a few places in the app, hence the use of a reusable element.
The popup is sort of a “Post a message” popup where there is a thing associated with the popup (i.e. a Message) and the input field gets dynamically populated with the message if the user is editing a message, or the field is empty if the user wants to post a new message.
In both cases above I would like to have the field both have a character limit and to have a count under it “0/650 characters”.
When I open the popup to post a new message it displays “0/650”, however, typing anything there and clicking out of the popup does not clear the countable element’s count if I were to open it up again. Wheres it would show an empty input but the count would say for example “11/650”.
I hope this makes sense, and yes having a countable element inside of a reusable element that works as a popup is what I am currently in need of, however, it is not your problem, so it’s ok if it’s just not possible at the moment.
I appreciate your response so far and thank you if you read down to here.
We have tweaked your testing project a bit, and made it work with the current setups, but changing a bit the workflow as per our previous instructions.
So first thing is required to actually show the popup and only then display the data. After that, we added a pause before next action so it takes time for the library to load everything, and then use plugin’s action to get Countable Values.