Select text in the text box based on user input?

I need to select (highlight) text that is present in the users choice i.e SystemPrompt from TextArea is shown where the user enters the desired text and if this text is currently present in the text box, put it highlighted, otherwise display additional information. Something like the search feature in the standard Notepad application.

I can't find what I'm looking for in a TextEditor.

Text of the text box is available by using the text property.

If you can access the text typed by the user and then the index can be easily calculated. Something like this (untested):

QString textAreaText = textArea->text();
QString userInput = ...;

int startIndex = textAreaText.indexOf(userInput, 0, Qt::CaseInsensitive);
int endIndex = startIndex + userInput.length();

Tags: BlackBerry Developers

Similar Questions

  • Hide the Table Sections based on user input

    I connected my form below. I'm trying to script the "Hide" button closed I want to hide all instances of the table "ActionItemGrp" sections when the user has entered a date in the field "ClosedDate". I tried the following script, but may not have to work.

    Form1.ButtonsPage.HideClosed::click - (JavaScript, client)
    for (var a=0;a<Table1.ActionItemGrp.instanceManager.count;a++){
    for (var b=0;b<Table1.ActionItemGrp.all.item(a).Table1.ActionItemGrp.Row5.instanceManager.count;b++) {
      if (Table1.ActionItemGrp.all.item(a).Table1.ActionItemGrp.Row5.all.item(b).ClosedDate.rawValue!==null)
       Table1.ActionItemGrp.all.item(a).presence = "hidden";
    }
    

    Link to my file on WeTransfer: http://we.tl/bmZjwdb52u

    The help is apprecaited...

    Ah ok.

    It is difficult, but this script should do.

    for (var t = 0; t < _Table1.count; t += 1) {
              for (var a = 0; a < xfa.resolveNode("Table1[" + t + "]")._ActionItemGrp.count; a += 1) {
                        var aTarget = xfa.resolveNode("Table1[" + t + "].ActionItemGrp[" + a + "]");
                        if (!aTarget.Row5.ClosedDate.isNull) {
                                  aTarget.Row3.presence = "hidden";
                                  aTarget.Row4.presence = "hidden";
                                  aTarget.Row5.presence = "hidden";
                                  aTarget.Row6.presence = "hidden";
                        }
              }
    }
    
  • AF:query of automatic execution under certain conditions the search form based on user input

    I read the post 160 in "not yet documented ADF application examples.
    I have a question. How can I create a view criteria according to ListOfValidDnames with a parameter that is the chosen filter Loc in ListOfValidLocs.
    Let me explain. The numbers the user or chooses 1700 in field Loc using ListOfValidLocs. I want to filter ListOfValidDnames with 1700.

    Thank you

    See this demo:
    http://blogs.Oracle.com/Shay/2011/01/dependent_lovs_in_an_afquery_c.html

  • Fill in a text box based on the list box selection?

    I'm relatively new to using scripts in forms.  So I hope that someone can help me here.

    I have a list box called 'Name', which uses the user selects a name.  I have a text box called "DOB", I need to be filled in automatically with the date of birth of the corresponding name that has been selected.

    I tried to adapt some scripts to fit my needs here, but nothing helps.  Although it seems like it should be pretty easy.  Any ideas?  Thanks in advance for the answers.

    ' 1. fill the list box with the name of "and place the date of birth in the option 'value exprot '.

    2. for action 'on blurr"add the following script:

    this.getField('DOB').value = event.value;

    When you tab or the mouse out of the list box, the value displayed in the field "DOB".

  • remove the selection text box in the text block related

    I chose text frames linked text frame

    out of the text and I want to delete a block of text

    Is it possible that an order letter

    B1.jpg

    same thing by selecting the external box

    B2.jpg

    Ok. Try now,

    var doc = app.activeDocument;
    app.findGrepPreferences = app.changeGrepPreferences = null;
    app.findGrepPreferences.findWhat = "~a";
    var found = app.selection[0].findGrep();
    for(var i =found.length-1;i>=0;i--)
    {
            var ip = found[i].insertionPoints[0];
            if(found[i].allPageItems[0] instanceof TextFrame)
            {
                    var cont = found[i].allPageItems[0].texts[0].duplicate(LocationOptions.AFTER,ip);
                    found[i].remove();
                }
        }
    

    Kind regards

    Cognet

  • Conditional display in the text box based on the calculated value

    Hello

    I have radio buttons that each have a numerical value. For example = 1 A = 2 C = 0. In the example below, the total is equal to 5.
    examplescreen01.gif

    The sum is displayed at the bottom of the document and is passed to another text box:

    examplescreen02.gif

    Instead of '5' displayed in the text box on the right, it should display a "Control" Word like this:
    examplescreen03.gif

    The displayed word is based on the totals through this range:

    1-2 = 'absorbing '.

    3-4 = 'practitioner '.

    5 to 6 = "control".

    The script I used to pass the value from the left to the right text box in the chart above is:

    name of the field to text box;

    var cTextBox = 'Cabinet Talent strategy knowledge - total';

    get the value of the field with the name in cTextBox;

    var sTextBox = this.getField ("cTextBox") .value;

    Set the value of this field;

    Event.Value = sTextBox;

    That I need to add to this script to show one of the words, such as "control" above?

    I am a complete novice to scripting. I found the above script online and somehow got it to work.

    I thank very much for any help or pointers, you can provide.

    Best regards

    Chris

    Sorry, there were some errors in the code that I provided above. Try this:

    If (sTextBox > = 1 & sTextBox)<= 2)="">

    Event.Value = "absorbing";

    } ElseIf (sTextBox > = 3 & sTextBox)<= 4)="">

    Event.Value = "practitioner";

    } ElseIf (sTextBox > = 5 & sTextBox)<= 6)="">

    Event.Value = "master";

    } else {}

    Event.Value = "";

    }

    If it still does not respond, you can send me the file at [email protected] and I'll check...

  • Execution of SQL queries based on user input in the text box on the page of the APEX

    Hello

    I am new to develop in the APEX, and I encountered a problem...

    It is even possible to do such a thing: use the text box to enter a SQL query and then run it on my schema and display the results in the report item? And if the answer is Yes, can someone give me advice on how to do this?

    Thanks in advance.

    In my example, the text is from a file in a text box. The report source is a function returning the SQL query:

    DECLARE
       v_query   VARCHAR2 (4000);
    BEGIN
    v_query := :p91_sql_query;
          RETURN v_query;
    END;
    

    Denes Kubicek
    -------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Apress.com/9781430235125
    https://Apex.Oracle.com/pls/Apex/f?p=31517:1
    http://www.Amazon.de/Oracle-Apex-XE-Praxis/DP/3826655494
    -------------------------------------------------------------------

  • Please help a poor beginner to open a text box based on a drop-down list

    Hello world

    I am quite new to the life cycle and my experience isn't in the lineup, so I hope that you will be kind to me. I designed a form that we use to send to our Bank to hire contractors. I need to make a text field become visible collection of some inscriptions on the drop-down list. for example, if an entry in the drop-down list "Holiday", I need another text field become visible to the user of maunally enter an extension number. If the user selects, say, "Study leave", I need the text box to stay invisible to the user.

    I hope this makes sense.

    Thank you guys & Gal

    Heavy E

    It is a java script placed on the drop-down list on the change event;

    If (xfa.event.newText is "Vacancy")
    TextField1.presence = "visible";

    else TextField1.presence = "hidden";

    Field1 text is defined as hidden

    To answer your second example, add in the same field:

    If (xfa.event.newText is ' Study/leave')
    TextField1.presence = "hidden";

    If it's confusing, let know us

  • Display of a text box based on a LOV

    Hello

    I have a form with a list of selection and want to display a text box when someone chooses another (value 5). When I use the selection list with redirect clears my entire form data, it will bring up the text bx. The text box has a conditional display of pl/sql: p2_orig_src_c = '5'. I don't want the form to submit from the selection list, because the user will not be performed of the incoming data in the form.


    I tried Dennis javascript and still not having a chance.


    < script language = "JavaScript" type = "text/javascript" >

    function SHOW_ON_ORIG_SRC_C_VALUE (pThis, PThat, pValue) {}
    var rv is $x (pThis) .value;.

    If (rv == pValue) {}
    html_ShowElement (pThat);
    } else {}
    html_HideElement (pThat) ;}
    }
    < /script >
    ----------------------------------
    Footer area:
    < script >
    SHOW_ON_ORIG_SRC_C_VALUE('P2_ORIG_SRC_C','P2_ORIG_SRC_NARR','5');
    < /script >

    -------------------------------
    Select the attributes of the list: (I probably put this in the wrong place)

    The HTML Form element attribute: onchange = "SHOW_ON_ORIG_SRC_C_VALUE ('P2_ORIG_SRC_C', 'P2_ORIG_SRC_NARR', ' 5');
    and for people with disabilities of the orig_src_narr conditional display


    All the tips are greatly appreciated.

    Thank you
    Mary

    Mary:

    If the second argument of the JS function is defined as "PThat", while your references to this argument in the code use "pThat?

    CITY

  • Spell in email vista says 'thiis language is no longer available for spell checking. Please select another in the dialog box options spelling. »

    Cannot find Setup spellling in Vista Ultimate.

    Cannot find Setup spellling in Vista Ultimate.

    Assuming that you are talking about Windows Mail or Windows Live mail (both procedures are identicle.)
    And assuming you speak English spelling corrector is not available...

    Open Windows Mail > tools > Options > Spelling tab > in Langauge section, click on the pointer, and then select one language other than English > click OK
    Repeat steps EXCEPT that this time select English as the language > click OK
    For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • You can mark the fields to show or hide based on user input?

    I have a 25 part form my users quite frequently - currently, it is stored in 25 documents Word and end users choose parts whatever they need and copy and paste into a form.  I am responsible for creating a form with all its 25 parts in there - not much, but the form should work so that the text they choose to is displayed and the rest is hidden. Is there a way to label conditional text field based on the selection of the end user?

    For example - there are checkboxes with a number followed by a text box with a sentence or 2 up to 5 or 6 short paragraphs. Users would select the required check boxes and have the text flow in a letter and the Coachman does not display areas of respective text that are disabled.

    Can I put each box and the following text in a subform and code somehow to display when the user wants?

    Thanks in advance for your help with this.

    R

    Sent the updated form a separately.

    Let me know if it helps.

    Thank you

    Srini

  • Text entry mode and user input validation

    Hey guys, someone tried to implement some sort of validation entry on BB 10?

    According to the literature, we have TextField that can be assigned to one of the variants of TextFieldInputMode: URL, PhoneNumber, NumbersAndPunctuation etc.

    There are no examples of this feature in action in the examples of Cascades source code on GitHub.

    I tried almost all variants of documentation and that you do not notice any changes in the local keypad. It always shows all the characters with special keys for user able to grasp everything that he or she wants. I guess that's what we call 'Default' variant of the keyboard. It's not good for me. At least, I want to be able to transmit a user through the regular expression input and generate an alert if something is wrong with the supplied value. But it would be much better to limit user input to some variants of the keyboard (for ex, keypad only)

    Here is my code:
    TextField {}
    ID: iValue
    hintText: "enter your value.
    inputMode: TextFieldInputMode.URL / / change this to what you want - without changes
    bottomMargin: 50.0
    textStyle {base: SystemDefaults.TextStyles.BodyText}

    layoutProperties: {StackLayoutProperties}
    horizontalAlignment: HorizontalAlignment.Fill
    }
    }

    Is it possible to show only digital keyboard and, possibly, use a regexp validation of user input at the moment?

    Yes, this guy's it via textChanging() signal and a regular expression.

    See this post on - http://supportforums.blackberry.com/t5/Cascades-Development/Preventing-non-numeric-key-presses-in-a-...

  • The buttons display based on users

    Hello

    I have 2 types of users using my request. They are admin and developers. They have different privileges. When logged on as Administrator , 2 buttons namely approve and reject must be visible. When you are logged as long as developers, only one button named forward must be visible. Please guide me to achieve.

    Buttons have Condition attributes and authorization scheme. You can use one of these two conditionally display a button.

    In your case, I'd both DEV and ADMIN authorisation schemes. Much easier to reuse in other situations.

    (You can actually create only the ADMINISTRATOR and approval {no ADMIN} allows to inform developers. This can lead to problems in the future when groups of users adding more)

    More information:

    https://docs.Oracle.com/CD/E59726_01/doc.50/e39147/bldr_attr.htm#CHDCJGCI

  • Use acrobat Pro to create an application form for my bike club with several checkboxes for favorite speeds, distances, etc. However, I would like to restrict users to select one of the 5 boxes.

    Using Acrobat 9 Pro to create forms.

    Each box give the same name but a different export value.

  • How can I delay the t0 to a waveform based on user input without affecting the beginning of another form of wave in the while loop?

    I would like the Waveform generated with the signal generator to wait until the user presses a button to start. I tried this implementation with a structure of the case, but have failed. The problem is that I don't know what to make out of case for when the user has not yet pressed the button.

    Consider using the structure of the event instead of the structure of the case. So pass the generator of waveform in the structure of the event, so that it will be executed when an event like the mouse click occurs. http://zone.NI.com/reference/en-XX/help/371361J-01/Glang/event_structure/

Maybe you are looking for

  • Is it possible to compress more that can compress Finder?

    Hello I would like to compress my files more compress Finder. Is this possible? How can it be done? Need me external software for it?

  • Cannot add apps to launchpad

    I drag an application to launchpad on the dock, but nothing happens. I click on launchpad and it isn't here. What's wrong? I have installed Mac OS Sierra.

  • Junk e-mail filter does not work

    For two months, a lot of messages ended up in junk e-mail that are not useless. Here are the messages from senders that I received already very well. People in my contacts. Messages are not marked as spam by the Mail app. I tried a lot of things: I c

  • Update disk on a Portégé R400

    Dear Forum member, I have a Portege R400. Now I want to spend my hard drive of the installed 80 GB 1.8 inch (IDE connector) with a higher capacity. Today, I called a Toshiba dealer and they told me, that this is not possible because all the new 1.8-i

  • Incompatible VISA read starting from 3458

    See the attached screenshots. My goal is to capture 4000 datapoints to a ramp of output voltage of 0 to 5v, with 3458A in LEVEL triggered 1v level, starting from the SALT ON signal that allows the output of the unit. I confirmed all signals are OK wi