Is it possible to count the words in a field

Is it possible to count the words in a field, and that the benefits of this county show upward in another area in LiveCycle? Like regular html Javascript code: If Yes, what is the correct syntax for the two different boxes? Thank you! Daria

See the attached example.  It uses regular expressions, so a few caveats:

1. my regex skills stink, so it cannot count words so perfectly that you like.  It is quite tolerant of special characters, but a string like "this & that" is taken into account 3 words, since the & is counted as a Word.  You can change the regular expression to fit your needs.

2. as this example uses regular expressions in javascript, it will work well in Reader and Acrobat, but I don't think it will work for forms rendered on the server (e.g. exit).  For some reason regex support is missing in the Livecycle server javascript engine. or if it is there it does not work on my server.

The script is located in the output: the data text box entry event.  You can type in (or paste) text in this text box and when you tab to the box, the number of words will be updated.  You can move the script in a different event on your form according to the when you counted words.

I would like to know how it works for you.

Tags: Adobe LiveCycle

Similar Questions

  • Count the words in the NOTES...

    With this script count the words, but I need to include the words of notes...

    myDoc = app.activeDocument
    T = 0
    for (var j = 0; myDoc.stories.length > j; j ++)
    {
    T = myDoc.stories [j].words.length + T
    }
    Alert ("You have" T + "words in this document")

    Thank you...

    Oh, you use notes, notes

    Then, this will do the job:

    var docWordCount = app.activeDocument.stories.everyItem().words.length;
    var docNoteWordCount = app.activeDocument.stories.everyItem().footnotes.everyItem().words.length;
    
    var myDocWordCount = docWordCount + docNoteWordCount;
    
    alert(myDocWordCount);
    

    Hopefully it will work now.

    --

    tomaxxi

    http://indisnip.WordPress.com/

  • count the words in a text widget

    Hello

    Is there a way I can count the number of words in a text box widget?  I realize that means counting the number of words in the attached variable - but can I do this?

    I tried to play with Javascript (which I know nothing)

    I put the following script in the script for a button pane, but nothing seems to happen!

    Test = Q5WidgetAnswer.Split (""). Length-1;

    document. Write (test);

    I want to check three words in a response, and if there are only two, or four, warns that there are three answers.

    Would be grateful for any help!

    After a lot of grief, I solved the problem.

    The code should be as follows:

    var objCP = document. Captivate;
    Var response = objCP.cpEIGetValue ('WidgetAnswer');
    Var words;

    if(Answer == '') {/ * empty response tests * /}
    Words = 0;
    Alert("Fred")

    }
    else {}

    Words = Answer.replace(/[^]/g,'').length + 1;    / * counts the number of places in response * /.

    }

    Where objCP can be any name that you want, and cpEISetValue and cpEIGetValue are special features of Captivate

    / * and * / add a comment

  • Is it possible to change the wording of the acknowledgement of receipt

    In order to make the status of an email I received more clear, I need to change the wording of the acknowledgement that sends Firefox. Is there a way to do this?

    Short answer 'NO '.

  • Query to count the values in a field

    I do the counts to the amount of entities in the database, I need to get the amount of registers for entities that appear

    Buenas, estoy trabajando Le con plsql there is me presenta a problema, Necesito UN count the amount of looking that returns the query por entity, estoy trabajando con UN procedure y evaluando don't con UN cursor, pero no be como hacer query trabajar para devolver ese valor homes


    GLOBAL ENTITY DATE TIME
    ======     =====     ====          ====
    ENT1 5 20100318 12:00
    ENT2 20 20100318 12:00
    ENT3 12 20100318 12:00

    CURSOR1
    SELECT distinct (rp.cod_entidad),
    YYYYYYYYY,
    TO_DATE (to_char (sysdate, 'YYYYMMDD'), 'YYYY-mm-DD') as fecha_pago,
    to_char(sysdate,'hh-mi-ss') as hora_pago
    REGISTRY PR, pc product
    where pc.nro_solicitud = rp.nro_solicitud
    and pc.resp_2 = 'OK '.
    and pc.resp_1 = 'OK '.

    Published by: 862673 on 31/05/2011 10:01

    Hello

    You don't want to then SEPARATE. Just use COUNT (*), which means "count records.

    Concerning
    Peter

  • It is possible to change the display of a field width in the report?

    Hello

    In my report, I want to increase or decrease the width of a field in the design document according to certain values.

    I used ' SRW. SET_BORDER_WIDTH (Width)' function, but it doesn't work.


    How can I treat?

    Regardly.

    Hello

    The field in the layout width depends on its horizontal elasticity and its content:

    http://www.Oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwcontxt/props/pi_lay_horizontal_elasticity.htm

    If the horizontal elasticity is set to "Variable", the field width will be automatically adjusted to the length of the content.

    Concerning

  • is it possible to change the word to the document microsoft word pad

    Is there a way to change a word pad to document microsoft word document

    Yes. However, methods available depend on what program you have installed.

    For example

    If Word is installed: open the document in Word Pad and save to RTF. Open the document saved in Word and re - save in Word format.

    Tom Ferguson

  • Is it possible to put the words in bold or underline things in email in thunderbird?

    When you send a note with the name of the books for example, I would like to highlight the name of the book which is the right thing to do, but I can't find anywhere in Thunderbird where I can use this option. Also, I can't find how to use italics or bold to emphasize something. Please notify. Thank you. Billie Matelski

    Perhaps you composed in HTML.

    Right-click on the account, in the folders pane, select settings and in composition and correct select compose in HTML.

  • Is it possible to add the car rental search field in a form?

    Hello

    was wondering if its possible to add a field of automatic search form and also receive the location of the person who submits the form with the form.

    Memo

    Hey Memo,

    Muse only currently allow you to add text single line, multi-line text box, but there is no way to add the geolocation Muse online form option. You can try this

    HTML5 geolocation

    I hope this helps.

  • Is it possible to display the number of words or number of characters in the selected text

    The Word Count utility has all the words in the document. Is it possible to count the number of characters or words in a piece of selected text?

    Re: is it possible to count the number of characters or words in a piece of selected text?

    Until you get an answer you like best, with the highlight text, right click, copy, paste into the blank document to LibreOffice Writer:
    Tools > statistics

  • How to count the number of words in a string?

    It is only possible by counting the number of white spaces in the string?

    You can use the String.Split method to divide the string into an array using the character space as delimiter, and then check the length property of the resulting table.

  • Need help to count the characters in several layers of text

    I use following code to count the number of characters and words in a single text layer. Is it possible to count the number of characters and words in a several layers of text. ?? Help, please

    Java Script code:

    //

    /*

    < javascriptresource >

    < name > Count words and characters < / name >

    < / javascriptresource >

    */

    function run()

    {

    var layer = activeDocument.activeLayer;

    If (layer.kind is LayerKind.TEXT)

    {

    Var words = layer.textItem.contents;

    Words = words.replace (/ (\r\n|\n|\r) "/ gm," "");

    var countwords = words.split("").length;

    var compteLettres is words.split("").join("") .length;.

    Alert ("\n" + countwords + "Words\n" + compteLettres + "Characters", "Count");

    }

    on the other

    {

    Alert ("select a layer of text.', 'Count');

    }

    }

    Run();

    2015, use it at your own risk.

    #target "photoshop - 70.032»

    If (app.documents.length > 0) {}

    var theTexts = main();

    alert (count (theTexts.join ("\n")));

    };

    ////////////////////////////////////

    int main() {}

    the file;

    myDocument var = app.activeDocument;

    get the number of layers;

    Var ref = new ActionReference();

    ref.putEnumerated (charIDToTypeID ("Dcmn"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));

    var applicationDesc = executeActionGet (ref);

    var number = applicationDesc.getInteger (stringIDToTypeID ("numberOfLayers"));

    treat the layers;

    var theLayers = new Array;

    for (var m = 0; m<= thenumber;="" m++)="">

    try {}

    Var ref = new ActionReference();

    ref.putIndex (charIDToTypeID ("Lyr"), m);

    var layerDesc = executeActionGet (ref);

    var layerSet is typeIDToStringID (layerDesc.getEnumerationValue (stringIDToTypeID ("layerSection")));.

    isBackground var = layerDesc.getBoolean (stringIDToTypeID ('background'));

    otherwise the layer group.

    If (layerSet! = "layerSectionEnd" & layerSet! = "layerSectionStart" & isBackground! = true) {}

    theName var = layerDesc.getString (stringIDToTypeID ('name'));

    theID var = layerDesc.getInteger (stringIDToTypeID ('layerID'));

    var hasText = layerDesc.hasKey (stringIDToTypeID ("textKey"));

    If the layer type;

    If (hasText == true) {}

    var textDesc = layerDesc.getObjectValue (stringIDToTypeID ('textKey'));

    Letexte var = textDesc.getString (stringIDToTypeID ("textKey"));

    theLayers.push (theText)

    }

    }

    }

    catch (e) {};

    };

    return theLayers

    };

    Count characters.

    function count (theString) {}

    Var words = theString//layer.textItem.contents;

    Words = words.replace (/ (\r\n|\n|\r) "/ gm," "");

    ////////////////////////////////////

    Remove double spaces and space at the end;

    While (words.indexOf("")! = - 1) {words = words.replace ("","")};

    spaces var end = \s$/;

    Words = words.replace (spaces, "");

    ////////////////////////////////////

    var countwords = words.split("").length;

    var compteLettres is words.split("").join("") .length;.

    return ("\n" + countwords + 'Words\n' + compteLettres + 'Characters');

    };

  • Count the number of comments in a PDF automatically?

    Hello O Experts,

    My documentation team members use Acrobat and Reader 8 and often need to count the number of comments in a PDF file. Is it possible to count the number of comments automatically? We cannot find this feature anywhere and resorting to the manual count. Because PDF documents can contain thousands of comments, it's very tedious. I tried to search the Web and these forums, but the words 'count' and 'comments' are too frequent in other contexts to find something useful...

    Thank you and best regards,

    -M.T.

    Just thought of another potential idea, that you can try if you use Sticky Notes.

    Do a search for Adobe on the generated summary of comments PDF to Word reminder and you will quickly see the number of instances in the document.

    sypark

  • How to count the time exactly?

    I tried to count the time using a VI like the one attached.

    It's that's not couting correctly. There is a possible reason, I have observed.

    The computer isn't able to handle the VI as soon as necessary.

    I thought about this because, when in edit mode the time count was very bad, and, when I created an application and installed, it ran okay, how 'light '. But today, when I tried to use this application with an old computer it did not work. The clock is slow.

    Is it possible to count the time correctly?

    I use a DAQ6009 to make my works, my VI is big enough and I need one iteration to each 1 ms (milliseconds) as I am with digital inputs from 5 events of coders (I know that's not the right way to count the encoders, but it's the only way I can do it, and it works).

    Thank you in advace! I hope you can help me!

    Hugs!

    Ok.  I will try to help you understand certain things.

    The number of cycles and wait (and wait until the next ms Multiple) functions all use a 1 kHz derived from the clock of the processor clock. The accuracy of these clocks is not large, although they are probably similar to the precision of the stopwatch.  Any time generated by these functions will show some differences in the time of the clock as it is derived from a different oscillator.

    Updates from the front panel are time by LabVIEW and the operating system. Most of the screens are updated with 60 to 80 times per second, maximum. What made the operating system, an update of the screen might be delayed by 10s of milliseconds or more.  It is certain that not all of the values at the end of the Add function will be displayed.

    Wait for him until the next ms many will wait more than 1 ms if the other code in the loop takes longer than 1 ms.  I don't know, but I think that the indicator is buffered so that any delay by the operating system to update the display should not slow down the loop. I tried to remove the flag, and it doesn't seem to make a big difference.

    I modified your VI to provide several indications of the performance. First of all, I added to the sequence of three-frame structure to allow synchronization of the loop. Second, I changed to a loop which runs a specified number of iterations. Thirdly, I hooked up the output of the timer until the next ms Multiple to a tunnel of autoindexing allowing a record of the time of each iteration appears in the table of ticks. I calculated the differences between successive instants and poster on a chart, so that you can see the performance.

    I didn't want to sound criticism of your use of English.  You write in English, much better than I could in your language!  What I was trying to make is that such general descriptions that ' Besides correctly ' without quantitative results or evidence in support of the application do not have enough information to help us help you.

    Lynn

  • How to count the number of updates in a loop Forall

    Hi friends

    I want to know is - it possible to count the number of updates occurred in FORALL. I share the codes below. His only return the iteration number. If I spend 5 through the values of the PARAMETERS and 2 updates the values in the table then return 5 instead of 2.  My requirement is to count the number of updates have taken place and return this value to OUTPUT parameter. If possible, please share codes. Thank you very much...

    CREATE OR REPLACE PROCEDURE UPDATE_PROCESS_RATE 
              (
               V_HOSPITAL_ID IN HOSPITAL_SERVICE_MASTER.HOSPITAL_ID%TYPE,
               V_USER IN VARCHAR2,
               V_DATE IN DATE,
               V_PROCESS_ID  IN VARR_ARRAY,
               V_PROCESS_RATE IN NUM_ARRAY,
               V_NUM OUT NUMBER
               )
    
    
                IS
    
                    V_ERROR_CODE NUMBER(15);
                    V_ERROR_MSG VARCHAR2(200);
                    V_ARRAY_ID NUMBER(10,2);
                    V_TOTAL NUMBER:=0;                                            
       BEGIN
                  SAVEPOINT Sp1;
             BEGIN
       
                   FORALL i IN V_PROCESS_RATE.FIRST..V_PROCESS_RATE.LAST
                 
                               UPDATE HOSPITAL_SUBSERVICE_PROCESS M 
                               SET M.PROCESS_CHARGE=V_PROCESS_RATE(i)
                               WHERE M.HOSPITAL_ID=V_HOSPITAL_ID
                               AND M.HOSPITAL_PROCESS_ID =V_PROCESS_ID(i);
                                                        
                   FOR i IN V_PROCESS_RATE.FIRST..V_PROCESS_RATE.LAST LOOP
                
                       V_TOTAL:=V_TOTAL + SQL%BULK_ROWCOUNT(i);
                   End loop;
               
                       COMMIT;  
                       V_NUM:=V_TOTAL;           
    
    
    
    
    

    IndiMinds wrote:

    But my requirement is: it must count the update only when it detects a different value from array. When it detects a different value in the table must be updated and count it and if the update of the table value is similar the TI should not count it.

    For example, if the V_PROCESS_RATE table have these 3 values (10,20,30) and we need to update these 3 values with (10,40,50), so no update, it should return is 2 not 3.

    Thank you

    And then don't update these lines, change your update statement

    UPDATE HOSPITAL_SUBSERVICE_PROCESS M
    SET M.PROCESS_CHARGE=V_PROCESS_RATE(i)
    WHERE M.HOSPITAL_ID=V_HOSPITAL_ID
    AND M.HOSPITAL_PROCESS_ID =V_PROCESS_ID(i)
    AND DECODE(M.PROCESS_CHARGE,V_PROCESS_RATE(i),0,1) = 1;
    

Maybe you are looking for