Removal of spaces of text with JavaScript entries (2016)

Hello

I hope someone could help me with a script or even a regular to remove the empty spaces between the words in the text entry boxes.  I found this thread from 3 years, but the code doesn't seem to work - I use 9 Captivate:

Remove the spaces from the text of the text input area

At the time was the posted solution:

var objCP = document. Captivate;

var jsTextEntry = objCP.cpEIGetValue ('TextEntryBox1');
var jsNoSpaces = jsTextEntry.replace (/ / g, ");

objCP.cpEISetValue ('varNoSpaces', jsNoSpaces);

But again, this does not work for me. Any suggestions? Thank you.

Bill

Nevermind, I think I thought about her. For future reference, this seemed to work - exchange the multi-word cpQuizInfoStudentName to OneWordName without spaces:

getName var = window.cpAPIInterface.getVariableValue ("cpQuizInfoStudentName");

newName var = getName.replace (/ / g, ");

window.cpAPIInterface.setVariableValue ('v_OneWordName', newName);

Tags: Adobe Captivate

Similar Questions

  • Remove empty space for the search query entry

    Hi guys, I am currently using JDeveloper 11.1.2.1.0

    I created a search with the use of criteria to display, query and table, which works perfectly with success.

    But I would like to improve the research by removing the empty space for the entry. For example, search for the name (with the search operator = Contains):

    Entry: Adam-> Works Fine!
    Entered: < space > < space > Adam not work :(

    I would like to remove the empty space at the beginning of the end (trim()) part of the entry.

    Any suggestion or comments?

    Please take a look at this thread
    publish in the search criteria for the ADF

    Seems to be the same requirement.

    concerning
    Peter

  • change the text with javascript innerhtml

    OK, so I have got it working somewhat, but cannot change more than once. I have 3 radio with a primary default buttons and view the value of this main button, which is $ 9.99. I want to change the $9.99 to $15.98 for the second button radio and $20.98 for the third option and back again to the radio etc. 1 and 2 button box.

    Here is my code

    < script type = "text/javascript" >

    function changeText1() {}

    document.getElementById('buy-1x-power-out').innerHTML = '$9.99 USD';

    }

    function changeText2() {}

    document.getElementById('buy-2x-power-out').innerHTML = '$ $15';

    }

    function changeText3() {}

    document.getElementById('buy-3x-power-out').innerHTML = ' $ USD 20,47 ';

    }

    < /script >

    < name of the form = the "power-out-form" method = "post" action = "" >

    < p >

    < label >

    < input name = "power-out-buy-selection" type = "radio" id = "power-out-buy-selection_0" value = "$9.99 'checked onclick =' changeText1 () ' >"

    1 @ $9,99 $ < / label >

    < br >

    < label >

    < input type = "radio" name = value 'power-out-buy-selection' =' $15.98 ' id = 'power-out-buy-selection_1' onclick = 'changeText2 ()' >

    2 @ $7.99 USD (20% discount) < / label >

    < br >

    < label >

    < input type = "radio" name = "power-out-buy-selection" id = 'power-out-buy-selection_2' onclick = 'changeText3 ()' value =' $20.97 ' >

    3 @ $6.99 USD (30% reduction) < / label >

    < br >

    < /p >

    < / make >

    total < p > < /p > < id p 'buy-3 x-power-out' = >$ 9.99 USD < /p >

    Thank you

    Total subsection ID is buy-3 x-power-out, but your functions try to change 1 - buy x-power-out and buy 2 x-power-out. Because they do not exist, the total does not change.

    Each function must target the same ID:

    function changeText1() {}

    document.getElementById('buy-__3__x-power-out').innerHTML = '$9.99 USD';

    }

    function changeText2() {}

    document.getElementById('buy-__3__x-power-out').innerHTML = '$ $15';

    }

    function changeText3() {}

    document.getElementById('buy-3x-power-out').innerHTML = ' $ USD 20,47 ';

    }

    In fact, it would be simpler to use an ID such as total.

  • Number of rows in a field of type text with Javascript

    Hello

    I have a form where I dynamically retrieve the number of rows in a text field.

    When I use getField(), I returned an object of type field. I see these rect properties, but nothing about the number of lines of text in the field.

    Any idea (except to get the height of the field and that dividing the height of a row)?

    Kind regards
    Karl.

    The number of lines is not a property that is exposed to a field (I've never seen this application before). Do you speak to find the number of rows in an empty field or has data in it (for example, I need to know how much data the user entered)?

    Maybe if you describe your use case we can come up with innovative ideas to solve.

    Paul

  • Remove / delete pages with javascript (or vbs)

    There is a MyPage.Add ()... There is no MyPage.remove ()?

    Can I delete a page with a script number?

    The problem:

    I have a problem facing pages. I need essentially to remove two pages to two pages, remove both and so on for about 2000 pages. Of course I could click and delete, but what would be the fun in that?

    The pages are created in a facing-pages datamerge. I do not understand why CS4 cannot manage in the face of datamerge pages... Whatever it is, I need a work around.

    Visually in the PAGES tab, what I have is the following

    Merge data entry enter merge data

    In the face of the Page A In the face of Page b.
    Merge data entry AMerge data entry A
    Merge data entry BMerge data entry B
    Merge data entry CMerge data entry C
    Merge data entry DMerge data entry D

    What A, A, B, B, C, C, D, D, etc.

    What I need to finish with is

    A B
    A
    B
    C
    D

    What A, B, C, D, etc.

    The rules: the database is untouchable. Face to face Pages A and B side are formatted differently.

    Any help or information leading to a job work around willl be rewarded of handsomly now that I get my cheque to a rich African uncle, I unfortunately discovered through an email today, had recently died.

    Thank you very much!

    Marc

    But there is a myPage.remove)

    There are frames of text on pages to delete block? In a script, it behaves exactly as in the UI: text block is moved to the next section in the thread (usually on the next page). So if this is the case, this script works but not the way you intended.

    In any case, you want to delete a single page, then go two pages - remove two pages - jump 2 - etc., until the end of the document.

    This Javascript should do it:

    var curpage = 0;
    app.activeDocument.pages[curpage].remove();
    while (curpage < app.activeDocument.pages.length)
    {
     curpage += 2;
     app.activeDocument.pages[curpage].remove();
     app.activeDocument.pages[curpage].remove();
    }
    

    It boings out with an error at the end if your document contains an odd number of pages (?), because he might try to remove a page after the last of them, but this isn't a critical error, it seems to me.

    I tested it on a document of 30 +, and it has successfully removed #1, then #4 and #5, then #8 and #9, etc. Yet, paranoia is a healthy lifestyle (when applied to computers), then running on a copy, will ya.

  • Text form field properties: access with Javascript?

    Hello

    I wonder if it is possible to access all of the properties of text form field with Javascript.

    The basic game is available under the domain object, but I'm looking for the other stuff that does not specifically exist for the fields of rich text, such as the properties of next paragraph:

    Dashes (left and right, withdrawal, first to the first line indent), the vertical alignment (top, bottom, middle), space above and below and attack (line spacing).

    All this is available if you place your cursor in a rich text field and press Ctrl-E to open text form field properties, then click on "More".

    So I wonder if it is also accessible via JS, because I can't find anything in the documentation on the subject.

    Thanks much for any help!

    Ariel

    Some properties of rich text are available, but not those you mentioned.

    I'm afraid.

    Study of the Span object to find out which ones are.

  • There is a large space under the text "with in the text box" that makes useless the useless space

    There is a large space under the text "with in the box"makes space unnecessary and useless, and I need an adjustment of the height of ".eps" method to remove this space.

    any suggestion except making cultures in pdf because he made mistakes of fonts?

    I think that this large bounding box is due to long letters in fonts which forced the entire police to take the same height

  • How to paste into the text field of the Clipboard with JavaScript?

    I implement the following actions in the form of javascript:

    1. a user clicks on a link on the PDF to open a web page

    2. the user uses the web page to find information and then copy text from the web page

    3. the user clicks a button on the pdf form and it formats the text to the Clipboard and paste them into the text fields.

    I can't find any references for the reading of the data from the Clipboard with javascript in PDF Forms. is it not possible?

    Perhaps 'not possible' was a little too hard. It would be a security hole if she accepts a script in a form to copy the contents of the Clipboard without the user explicitly allowing it. It has been possible to copy the contents of the Clipboard into a form field using the app.execMenuItem method without the user knowing / allowing it, but that hole was closed. The restriction can be overcome, as explained in the documentation: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.143.html

  • Replace h1 with Javascript or CSS image text?

    For SEO, I want to have a h1 Tags at the top of my page title. However, I would like to use an image for the freedom of design. I see 2 solutions to this problem:

    I could either use of css to 'hide' the text. I know that google does not like hidden text, but I could use the index z CSS (or margins?) so that the image appears not in the text. Im not a expert on accesabilty devices, they sometimes use some CSS?

    The other option is to hide text and display an image with javascript. I understand that it's better for accesabilty. However, I do not data soild on it, but a few sites I've found say 10% of people have javascript disabled. What is the number that high?

    Maybe I should use javascript to display an image, but if it is turned off still have some pritty CSS styilng the title h1 and its div.

    Im sure im not the first person to have this dilemma so that everyone recommend?

    Thank you

    Hello

    JavaScript is disabled mainly on the company's computers, unless you run your site to these users worry not too on this subject (you can always check site statistics to see how many visitors actually have javascript disabled), and the number (estimated) current 'normal' users who disable javascript is only 1-2%.

    Regarding the replacement of your text check this article (complete with the required javascript code).

    http://www.quirksmode.org/DOM/FIR.html

    PZ

  • Regular expression to remove the space in the HTML tag

    Hi all

    My HTML string is as below.

    Select ' < CityName > RICHMOND < / Nom_ville >< StateCd > ABCD CDE< StateCd / >< CtryCd > CAN < / CtryCd >< CtrySubDivCd > BC < / CtrySubDivCd > ' double Str

    Output desired is

    < CityName > RICHMOND < / Nom_ville > < StateCd > ABCD CDE< StateCd / > < CtryCd > CAN < / CtryCd > < CtrySubDivCd > BC < / CtrySubDivCd >

    I want to remove these spaces of the tag value box with only spaces otherwise leave it as what. Please help to implement the same using regular expressions.

    Hello

    We don't know what you want.  This site seems to be formatting your message in a weird way.

    As the statement

    SELECT «...» "THE DOUBLE;

    without formatting, to show your entry and after the exact output desired friom as, with as little in shape as possible.  It might be useful if you use some character like ~ instead of spaces (just for viewing; we will find a solution that works for spaces).

    To remove the text which consists of spaces and nothing else between the tags, you can say

    REGEXP_REPLACE (str

    , '> +<>

    , '><>

    )

    How is this string generated?  Maybe there is an easier and more effective way to keep the bad wrtings sub off the chain in the first place.

  • HP ENVY 7640: Jobs of text with images - printer cancels

    When I print a text with images document the printer stop printing and cancels the print job when it starts to print any image.

    Help

    Hey @sudiegal!

    Thanks for posting on the HP Forums!

    I would be happy to provide you with some suggestions that may fix the problem.  I see that the printer cancels jobs when you add a photo to you text document.  The first thing I suggest is to remove the printer by resetting the printing system.  After removing the printer add printer and then try printing the document again.

    To reset the printing system:

    1. click on the Apple in the top left of the computer icon

    2. click on System Preferences

    3. click on printers and Scanners

    4 press and hold 'Ctrl' on the keyboard and click with the mouse in the space below the printer

    5. click on reset the drop-down list printing system

    6. we may request for Mac ID and color wheel for a while until the printer is deleted

    To re-add the printer:

    1. click on the Apple in the top left of the computer icon

    2. click on System Preferences

    3. click on printers and Scanners

    4. click on the plus sign (+) icon in the list of printers

    5 Select your printer

    6. choose HP ENVY 7640 series in the drop-down list next to 'use' or 'print using '.

    7. click on add

    If please, after back and let me know if it works for you!

  • Client with JavaScript listener, surrounded by a button have a delay

    Hello.

    I have a fragment page (jsff) with a resulting keypad buttons surrounded by a client listener that calls a java script function; whenever I click on a number it refresh a text with the concatenated value input. I've implemented with JavaScript. Why with JavaScript? Because of the delay using partial triggers showing the value in the input text.

    When I test it on the server, it works fine. I click on each button and have a little late, but it works for the needs to develop.

    Now, when I insert this fragment inside an another jsff which include several elements, the result is not the same. I click every button and the value is displayed in the text of entry very fast, but the I clicked on the button takes between one and two seconds to recharge for summer clicked again. I don't understand what is happening.

    Could someone help me?


    Thank you very much.

    Probably you always spread the event on the server. You can easily check this with a browser like Firefox/Firebug plugin, sent to see if there is no request for the server.

    Normally, you will need to explicitly cancel the event to propagate to the server. For example, if you have a clientListener on a button, you do something like below:

    function showPopupFromAction(actionEvent)
    {
      actionEvent.cancel();
    //your logic here

    }

  • Removal of spaces

    Hi all

    I have a text like 'abc [oracle database] ABC'... Output, I need love 'ABC abc [oracledatabase]... "

    Thanks in advance

    977863 wrote:

    Hi all

    I have a text like 'abc [oracle database] ABC'... Output, I need love 'ABC abc [oracledatabase]... "

    Thanks in advance

    Lookng at the u sample provided it seems that you want to remove the spaces between the text inside of [the] - hooks.

    Right?

    Like this:

    SQL > ed
    A written file afiedt.buf

    1 WITH xx AS)
    2. SELECT 'ABC abc [oracle 10g database]' txt FROM dual
    3)
    4. SELECT
    5 REGEXP_REPLACE (txt, ' (.*\s*\[)(.*)(\]\s*.*)',Trim('\1'))||)
    6. REPLACE (REGEXP_REPLACE (txt, "(.)")) * \s*\[)(.*)(\]\s*.*)','\2'), Chr(32)) ||
    7 REGEXP_REPLACE (txt, '(.*\s*\[)(.*)(\]\s*.*)','\3') result
    8 * XX

    SQL > /.

    RESULT
    ---------------------------
    ABC ABC [oracledatabase10g]

  • Remove the spaces and special characters to a form field

    Hello

    I am tragically new to all this, but I'm trying to create a form in Adobe Acrobat 9.  I am trying to use a custom script Format to make entries in a form field and automatically remove the spaces and special characters (hyphens specifically).  For example, if a user 'RAN - 99 06' entries I want to change it to "RAN9906."  I found this script that does not allow users to input special characters

    If (! event.willCommit) {}


    Event.change = event.change.replace (/ [------$# ~ %------*------*------^-------------(\)------+=------[\]------{\}; \ "\ <>\ \?"]) \ | \\\ !] /g, "");

    }

    And it's OK, but I can't understand how to prohibit the spaces.  In addition, the perference would be a script to allow users to enter data as they wish, but to clean after leaving the text field.

    Thanks in advance!

    Yes, there are a few changes during the passage of the code of the event in the sequence of keys to the Validate event.

    First of all, you need not try the willCommit. In fact, when the sequence of events of field reached the Validate event, the field is already committed. The Validate event does not therefore the property of willCommit.

    Secondly, in the Validate event, you work on the event.value and either event.change. Thus, you will replace accordingly.

    And who should actually do.

    I hope this can help.

    Max Wyss.

  • Remove the spaces of a variable

    I have a variable called "enteredname": -.

    var enteredname:string;

    When the user enters text in my "nameentry" and click on a button input text, the text you enter is saved in this variable: -.

    enteredname = nameentry.text;

    This variable is then sent to a server and set it as the name of the item, the user added via the http request, however, I would like to add in another variable string "enteredimagename", which will store the same text but will have spaces removed or all characters that would not be appropriate to a JPEG image.

    The idea of this is that the user adds a name of a part of their addition and eponymous is applied as long as the elements of the title and the name of the image file of points (with all spaces removed etc.) because all the images in my application are stored on a server and are dynamic so the click would look like:-

    enteredname = nameentry.text;

    enteredimagename = nameentry.text (with code to remove spaces for this channel or something)

    Can someone help me with this?

    I don't know which characters, you can use in the name of the file, but you can always limit to A - Z and a - z to be sure.

Maybe you are looking for