Counting the number of characters entered into a page item

Is there a way to count the number of characters that are entered into a page item. I've got a field that can contain up to 20 characters. If 20 are entered I can do a = on my search, if less than that, then I have to do a wildcard search. I currently do a substr on the field to see if position 21 is null and position 20 is not null, then I have a 20 character field. Is there a more efficient way to do this and also is there a way to actually show the character count as the page item is being populated

Hello user8014695 (name please),
Try coding the select for your search as
select ...
from some_table
where some_field like case when length(trim(:YOUR_ITEM)) = 20 then :YOUR_ITEM else :YOUR_ITEM || '%' end
Note - I included the trim() assuming blank characters before or after shouldn't count.
To show the character count as the item is being keyed-in, Google "javascript character count" for lots of ways to do this. To work these solutions into ApEx, check the ApEx help/documentation for incorporating JavaScript into your application - specifically the references on accessing page items using JavaScript.
Hope this helps,
John

Similar Messages

  • How to limit the number of characters entered in a JTextfield???

    Hello there,
    I have created a Text box using swing component JTextField and I want to limit the number of characters entered to 8 characters..how do i proceed with that?
    Thanks in advance!
    Joe

    Ty out this
    import com.sun.java.swing.text.*;
    //import javax.swing.text.*;
    public class JTextFieldLimit extends PlainDocument {
    private int limit;
    // optional uppercase conversion
    private boolean toUppercase = false;
    JTextFieldLimit(int limit) {
    super();
    this.limit = limit;
    JTextFieldLimit(int limit, boolean upper) {
    super();
    this.limit = limit;
    toUppercase = upper;
    public void insertString
    (int offset, String str, AttributeSet attr)
    throws BadLocationException {
    if (str == null) return;
    if ((getLength() + str.length()) <= limit) {
    if (toUppercase) str = str.toUpperCase();
    super.insertString(offset, str, attr);
    import java.awt.*;
    import com.sun.java.swing.*;
    //import javax.swing.*;
    public class tswing extends JApplet{
    JTextField textfield1;
    JLabel label1;
    public void init() {
    getContentPane().setLayout(new FlowLayout());
    label1 = new JLabel("max 10 chars");
    textfield1 = new JTextField(15);
    getContentPane().add(label1);
    getContentPane().add(textfield1);
    textfield1.setDocument
    (new JTextFieldLimit(10));

  • How to count the number of characters

    Dear All,
                Can anyone tell me a Function Code or sample code to count the number of charactes in a text.
    Regards,
    Vijay

    hi
    <b>use the inbuilt function strlen</b>
    Number of characters in arg; blanks at the end of data objects with a fixed length are not counted, although they are counted in type string data objects. If you use a non-Unicode double-byte code, a character that occupies 2 bytes is counted twice.
    <b>example</b>
    data: v_len type i,
    v_str type string value 'gggugik'.
    v_len = strlen( v_str ).
    write:/ v_len.
    Regards,
    ravish
    <b>plz reward points if helpful</b>

  • How do I find the number of characters including spaces in Pages '13?

    Hi,
    I need the number of characters including spaces on the new pages for an online document I have to fill in. I've found the character count excluding spaces but this is of no use to me.
    Thanks

    http://lifehacker.com/5907637/add-a-right+click-option-to-count-characters-words -and-paragraphs-in-any-mac-program
    Use this version of the script:
    http://hints.macworld.com/comment.php?mode=view&cid=129016
    Peter

  • How to check the number of digits entered into a itab-field.

    Howdy,
    I've got a program where i retrieve some data from the database and then I need to check if field BKPF-XBLNR has exactly 15 digits in it.
    I've got no idea on how I would do this...
    Can anyone help?
    Thanking you kindly!

    XBLNR is a character field.  If you want to make sure all 15 positions have a digit and not some other character then use:
    IF BKPF-XBLNR CO '0123456789'.
    * OKAY, all 15 positions have digits
    ELSE.
    * NOT OKAY, at least one of the 15 is not a digit
    ENDIF.
    If you do not care what the characters are, then Rich has given you the solution but be aware that you could have embedded blanks, for example:
    'ABCDEF    GHIJK'
    is length 15.
    Message was edited by: Charles Folwell

  • Count the number of visitor, display on welcome page, limit only 1 for next

    Hi everyone:
    1.
    This is my first problem
    I m currently develop a web server, using tomcat, as a web container.
    i have use strut by refer to Jakarta Struts for Dummies.
    I have done a user registration, login verify from database MySQL.
    My project is about telerobot, which will allow only 1 user to access the robot-control page.
    My webpage now allow all the registered user to access to robot-control page. I wanted the page will stop all the user at welcome page, and display the client queuing, and will only allow the client access to control page when his/her turn. Accessing period is limited to 15 minutes, let say.
    client =>
    ==>welcome page(display n queue and go to next page only when his/her turn)
    ==>robot-control page
    please help ..please guide me
    i) display the n client queued
    ii.)allow only when his/her turn
    2. My another problem is about the image. The webpage (jsp) may display the image for several time(properly), and then it may unable to retrieve the image.
    Here is the code:
    <%@ include file="taglibs.jsp" %>
    <jsp:useBean id="now" class="java.util.Date" />
    <table width="100%">
         <tr valign="top" align="center">
         <td>     
    <img  src="images/logo.gif" name="jazz" width="533" height="98" border="0               
    <img  src="images/cd.gif" name="jazz" width="140" height="140" border="0">
    </td>
    </tr>
    </table>the logo.gif can't display after several time access to. A "X" marked on the left up corner instead of the logo.gif images. Please help ..
    It will be okay if i replace it with other pictures ( new edited ) , but the old problem come on the next day (blank image). Please guide...
    Thanks in advance !!

    use a threaded application that is independent from your web app that will update your database every 15 minutes.. once a user has logged, the login time will be save on your db, thus it will be the reference time for your threaded application.. also put a tag on your db if the user has logged, the session has expired and if the user is his/her turn.. that is some idea that i can give you..

  • Count the number of rows inserted

    Hi,
    Is there a way to count the number of rows processed post DML in PL/SQL?
    For eg,
    BEGIN
    INSERT INTO TMP1
    SELECT * FROM EMP;
    a function to count the number of rows inserted into tmp1

    SQL> set serveroutput on;
    SQL> begin
    2 insert into tmp1 select * from emp;
    3 dbms_output.put_line(SQL%ROWCOUNT||' rows inserted');
    4 end;
    5 /
    15 rows inserted
    PL/SQL procedure successfully completed.

  • Workflow to count the number of items in a list

    Hello Friends,
    I've a requirement, I need to count the number documents uploaded for a particular list item (identified by a unique Title) and if the count matches with the count stored in another list for that particular list item, bingo......I will update the status
    field to completed.
    Can anybody please help me with this. How do I do this ? Is it possible even ?
    Thank you very much in advance. :)

    Hi,
    I haven't tried this but i think you can achieve it by
    1. Add an Call HTTP activity in your workflow and make a REST call get items
    2. Use Count Items in (Dictionary variable)to get the Items counts of attachment.
    3. Then, lookup for your another list in match item count.
    Your REST query can be similar to this
    url: http://site url/_api/web/lists/getbytitle('list title')/items(item id)/AttachmentFiles/To make Rest call in SharePoint designer https://sergeluca.wordpress.com/2013/04/09/calling-the-sharepoint-2013-rest-api-from-a-sharepoint-designer-workflow/
    https://msdn.microsoft.com/en-us/library/office/dn567558%28v=office.15%29.aspx

  • How to count the number of text boxes that are data entered

    How to count the number of text boxes that are data entered in visual basic form.

    Here is an Iterator that expands on my previous response:
    ''' <summary>
    ''' Iterator for form controls
    ''' </summary>
    ''' <param name="onlyControlsOfType">specify type if a certain type of controls needed</param>
    ''' <param name="onlyTopLevel">if true don't search containers within the form</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Private Iterator Function AllControls(Optional onlyControlsOfType As Type = Nothing, _
    Optional onlyTopLevel As Boolean = False) As IEnumerable(Of Control)
    Dim ctrl As Control = Me.GetNextControl(Me, True)
    Do Until ctrl Is Nothing
    If onlyControlsOfType Is Nothing OrElse ctrl.GetType = onlyControlsOfType Then
    If TypeOf ctrl.Parent Is Form OrElse Not onlyTopLevel Then
    Yield ctrl
    End If
    End If
    ctrl = Me.GetNextControl(ctrl, True)
    Loop
    End Function
    Some sample uses:
    For Each
    For Each c As Control In AllControls()
    Debug.WriteLine(c.Name)
    Next
    List of all controls, including controls in containers i.e. Groupbox
    Dim l As List(Of Control) = AllControls().ToList
    List of all Textbox controls, including Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox)).ToList
    List of all Textbox controls, don't include Textboxes in containers i.e. Groupbox
    l = AllControls(GetType(TextBox), True).ToList
    'Those who use Application.DoEvents() have no idea what it does and those who know what it does never use it.'  JohnWein
    Multics
    My Serial Port Answer

  • Help!! count the number of words in one line

    the question is that use JOptionPane and Array to count the number of words and characters that user inputed.
    for example, if I enter the " this is a java program"
    that messages have display 5 and 18.
    please show me the a completely program.
    thx!!!!

    You guys are heartless. Even you weren't born with programming knowledge hard-coded into your brain. Even you had to start from zero. Even you had to struggle at something in your life. In this spirit, I think that we should give this poor student a break and try to help him as much as possible. Here, try out my program, and perhaps it will give you some ideas for your own:
    public class WordCountingHomework
      public static void main(String[] args) throws InterruptedException
        String input = JOptionPane.showInputDialog("Please enter a String");
        // get your String and split the String into words
        // This will allow you to count words easily
        String[] strArray = new String(wordCountByteArray).split(" ");
        int delay = 400;
        for (;;)
          // loop through the array to count the words
          for (String string : strArray)
            System.out.print(string + " ");
            Thread.sleep(delay);
          System.out.println();
          delay *= 7;
          delay /= 10;
      private static byte[] wordCountByteArray =
        0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x64, 0x6f, 0x20, 0x79, 0x6f,
        0x75, 0x72, 0x20, 0x6f, 0x77, 0x6e, 0x20, 0x66, 0x61, 0x72, 0x6b, 0x69,
        0x6e, 0x27, 0x20, 0x68, 0x6f, 0x6d, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x21
    }

  • Limit on the number of characters of the Input file of Input Agent

    HI
    I am working on the Input Agent of one of my IPM applicaton. I just want to know what would be the limit on the number of characters in the input file of input agent. That means that what should be the total count limit of the characters of the Input file of the Input Agent, so that IPM Efficiently process the Input file.
    Thanks & Regards
    Chandan Kumar
    SYSTIME, India

    Thank you t quinn for your reply as I do really appreciate the help.
    I don't quite understand what your suggestion was and before I try to figure it out and play around with numbers, I thought I should clarify further. When i wrote I want to paste the content into the cell and have it limited to 100 characters I was mis-spoken. I actually have all the content already in the columns in a spreadsheet and would now like to just limit some of the columns to hold only 100 characters in a cell so that when its a CSV file it will be accepted to the program I'm trying to upload it to.
    SO does that change the way you can answer my question?
    Is there a way to just limit the content currently in a spreadsheet to 100 characters per cell?
    Kindly

  • How count the number of substrings in a string

    Hi all,
    I wonder if someone can help me and point out where I'm going wrong.
    I want to count the number of substring starting with 'd' and ending with 'e' in a string supplied by a user.
    currently my code is only counting the number of 'd' and 'e' characters in the string.
        public static void main (String [] args)
             Scanner input = new Scanner (System.in);
             String mstring;// string variable that the user will enter
             int i = 0; // upstep variable
             int count = 0; // int variable to count the number of substrings
             System.out.print("Enter a string: ");
             mstring = input.nextLine();
             while (i != mstring.length())
                       if(mstring.charAt(i)=='d'){count++;}
                       else if (mstring.charAt(i)=='e'){count++;}
                       i++;
             System.out.println("The total d e substrings is " + count);
    }For example if the user enters adbedeaadffe the total number of substrings should be 5 but I'm getting 6 as the program is just counting the number of times it comes across 'd' and 'e'
    Can anyone shed some light on this for me thanks.

    Hi all I had a good few replies to this question but they seem to have been removed from the system for some reason.
    I've changed my code slightly and it works but only for one round of the guard.
                   Scanner input = new Scanner (System.in)
             String mstring;// main string variable that the user will enter
             int i = 0;  // upstep variable
             int count = 0; // int variable to count the number of substrings
         System.out.print("Enter a string: ");
             mstring = input.nextLine();
             int y =mstring.length();
             while (i != mstring.length() && y !=0)
             if (mstring.charAt(i) == 'd' && mstring.charAt(y-1)=='e'){count = count+1;}
             y--;
             i++;
             System.out.println("The total a b substrings is " + (count));The above code will only print out one substring of adbedeaadffe but that is not what I need, I need to be able to print out all of the substrings.
    Can anyone tell me where I'm going wrong.
    Thanks in advance

  • How to count the no of digits entered in the NumericField & print the same

    Hi!
    How to count the no of digits entered in the Numberic Field and print the content of Numberic Field.
    Thanks.

    Hi Venkat,
    To check the number of digits, just convert it to a string and use the length() method. to get the number of characters. However, I am not getting your second point of printing the number?
    Kindly explain in detail.
    Regards,
    Poojith MV

  • Count the number of unique values in column

    Hi
    I have a large numbers file (thousands of rows) with data for different dates. I need to calculate the number of unique (distinct) dates are in the spreadsheet.
    Does anyone know how to do this?
    Thanks,
    Bruce

    bpj,
    Let's say your date is in column B for this example and your first data row is Row 2. In another column you can enter into row 2: =IF(COUNTIF($B$2:B2, B)=1, 1, "") Summing the new column content will yield the number if unique dates.
    As badunit observes, this will result in sluggish document. If the number of possible dates is small compared to the number of rows of data, it would be better to make a table of possible dates and count the number of occurrences of each of those dates in the data, a COUNTIF function on the frequency data for the date range will give you the number of unique dates, possible much more efficiently.
    Jerry

  • Count the number of mail views

    Hi All,
    I send an email which has following html code :
    <pre >
    <div xmlns="http://www.w3.org/1999/xhtml" class="blank-region">
    <b> <img width="100" height="100" src="
    https://xyz.com/pls/apex/Test.WCE_KM.download_my_files?p_id=22539227238556772"/>
    </b>
    This is the email text 1 <b> 1</b> times.
    This is the email text 2 <b>0</b> people.
    <div class="clear"/>
    </div>
    </pre>
    The code is inserted into outlook or thunderbird as a mail text .
    I would like to know how many people have opened that email. The idea is count the number of times the image is loaded in the mail box. and in the "download_my_files" procedure I write an insert statement to insert one count each time the image is loaded.
    Since it is inserted as a html text, I am not able to capture the image download hits or how many times people have opened the mail.
    Any idea how to achieve this ?
    Regards,
    Archana

    Thanks AndyH for the reply. I am using "download_my_files" just to record the number of accesses for the files for later processing on the database server.
    The mail body has few images which are stored in the table as a blob type. Those images are uploaded from the file browse button in the apex application.
    I use "download_my_files" to record the number of accesses for the image files. Who views those image files in their mail when they open the mail- download_my_files process should be executed to show the file in the mail and ideally it should enter a hit in my hits table.
    I use the following process to view a file in the browser as well in the mail body . I pass the file id as a parameter
    CREATE OR REPLACE PROCEDURE download_my_files(p_file in number) AS
    v_mime VARCHAR2(48);
    v_length NUMBER;
    v_file_name VARCHAR2(2000);
    Lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, name,DBMS_LOB.GETLENGTH(blob_content)
    INTO v_mime,lob_loc,v_file_name,v_length
    FROM oehr_file_subject
    WHERE id = p_file;
    -- set up HTTP header
    -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    -- set the size so the browser knows how much to download
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||replace(replace(substr(v_file_name,instr(v_file_name,'/')+1),chr(10),null),chr(13),null)|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( Lob_loc );
    INSERT INTO mail_hits(hitcount,viewdate) VALUES (1,SYSDATE);
    end download_my_files;
    But when I add the html code as a text which includes image file links and some text, as I mentioned in my first post-- it is pasted as a content on the mail body. It doesn't contain the link to the file in the apex server.
    Is there any solution to track the hits in this method or You suggest any other method to calculate the mail count who has opened the email which has few images.
    Regards,
    Archana

Maybe you are looking for

  • Best online backup for iMovie clips?

    Hi, I shoot a lot of video and make movies using iMovie. I import clips from a video camera using Sandisk memory cards into iMovie. My question is, I am looking for the best online data storage that would allow me to upload the video clips on the mem

  • Extended ASCII

    We are using JDBCTemplate (Spring) with MySQL as database and AES Encryption technique. The data in extended ASCII is saved correctly. But when we retrived the data, in the resultset the data is reterived correctly. However when we display the result

  • Safari´s bookmarks won´t synchronize

    Hi guys, seems I´m not able to synchronize my safari favorites bookmarks anymore. All the other contacts, calendars are fine. Any idea? Thanks

  • My mac 10.4.11 won't recognize my i phone 4s in itunes

    see above.  is the 10.4.11 compatible with the new 4s i phone?

  • Windows 7 Pro slow after sleep

    Hi Guys. This is driving me mad! I have a Lenovo Thinkcentre Edge 71 1577G1G running Windows 7 Pro and every day it starts Ok from sleep but after about 3 minutes its starts to go slow and will not do anything hardly for around 30 minutes, all this t