1. Overview
We know that there is an inbuilt option to restrict character count in oracle apex. But in some scenarios we may have to know how many characters we have entered in the page item. The following steps will help you to count the characters and it will show the count near to the page item.
2. Technologies and Tools Used
The following technology has been used to achieve the same.
- Javascript
- HTML
- Oracle Apex
3. Use Case
Suppose you want to make the count of entered characters you may use this method and find how many character have entered.
4. Architecture
Following steps explains in detail,
Step 1: Create a new blank page.
Step 2: Create a new region
Under identification you can give the title
Step 3: Create Page Items which need to be count the length of the character.
Step 4: Write a Javascript code to count characters.
$(“#P4_COUNT_CHAR”).on(“input”,function(){
if(this.value.length > 0){
$(“#count”).text(this.value.length);
}else{
$(“#count”).text(“”);
}
});
$(“#P4_PROJECT_NAME”).on(“input”,function(){
if(this.value.length > 0){
$(“#totcount”).text(this.value.length);
}else{
$(“#totcount”).text(“”);
}
});
Step 5: Write a below HTML Query on page item’s post text area.
<span id=”count” style=”padding-left: 5px;border: 1px solid Green;text-align :center;
font-weight: bold;color:orange;font-size: 16px;padding-right: 5px;”></span>
Change the id for another page item ,like below
Now the out put will be like this
After Entering value it will be like the below one
If you want start the count from 0 then just follow the below
Now the count starts from 0 and the out put will be like this,
5. Screen Shot
Output