Make text bold using javascript

To make it short and simple, here is what I need to do:
In my javascript, I have a long string of concatinations. I need to be able to make some of the words in the string bold, and others normal. I have tried the str.bold() method and that doesn't seem to be working for me. It simply displays bold tags around the word in the text field when I preview (
word). I have the text field as a 'rich text' as well as 'xhtml'.
Any advice on how to bold words using javascript would be great. I have looked through the forums and havn't found anything helpful so far.
I am using Livecycle 8.
Thanks in advance.

If you could give me an example, it would be great. I'm looking at the span object right now to see if it's something I could use.

Similar Messages

  • Script to make texts bold or italic

    I saw someone suggested the following code to meet the need:
    var app = new Illustrator.Application();
    var doc = app.ActiveDocument;
    var bold = doc.CharacterStyles["Bold"];
    var italic = doc.CharacterStyles["Italics"];
    var frame = doc.TextFrames[0];
    bold.ApplyTo(frame);
    italic.ApplyTo(frame);
    But it does work in my case since "doc.CharacterStyles["Bold"];" and "doc.CharacterStyles["Italics"]" declare an error message of "No such element". Is there another way that I can try to make texts bold or italic?

    look here
    http://forums.adobe.com/thread/881071?tstart=0

  • Read-Only Text Field Using JavaScript Code

    I'd like to make a text field read-only by using JavaScript and also having IF & ELSE statements.
    I want it to be like this:
    if the answer from the dropdown menu is YES, then the text field is read only but if the answer is NO then the text field is fillable.
    Thanks in advance

    Use this code as the custom validation script of the drop-down in question:
    this.getField("Text1").readonly = (event.value=="Yes");

  • Inserting PNG images in my document makes text bolder

    I created a simple InDesign file using text and JPG images. So far all fine.
    But on pages where I use PNG images instead of JPG images all text on the page is slightly bolder as if some sort of overprint would apply to all text boxes, even the once placed on the Master Page.
    I checked all overprint settings, it's not it.
    Any idea?
    Thanks
    ralph

    That is indeed the problem.
    Any ohter workaround than flattening the images in Photoshop?
    Thanks
    ralph

  • Conditional validation of date and text fields using javascript

    How can we validate text and date field in sharepoint newform based on a check box.
    i have used validation settings but it do not full fill my requirement.
    i have checkbox with 4 values user can select all four values or can select any of the value. Based on the selected value i need to fire alert on a textbox and date field. Help is much appreciated.

    Hey Dilip,
    You can write your own javascript logic to achieve the same in content editor webpart on newform of list. try below links and let me know if you need further details.
    using jquery validation plugin to validate
    choice filed
    JQuery validation-select required if checkbox checked
    Thanks.

  • Mac Mail no longer allows me to make text bold

    I'm using Lucida Grande as my default font, and since installing Snow Leopard the command>b no longer emboldens the type. Even if I go to format>style>bold it still doesn't work. Even if I go to format>show fonts and select the bold version of the font it still doesn't work.
    Any ideas?

    Hi chaps & chapettes
    My system is running OS X 10.6.4 and Safari 5 (which is when the problems started) (and Mail 4.3)
    I managed to sort this problem after tryin everything from:
    *Font Book:*
    - resolving duplicates
    - validating fonts (and deleting all the warning & corrupted fonts)
    *Linotype FontExplorer X*
    - Clean system font caches
    system/library/fonts
    - manually deleting Helvetica and Helvetica Neue
    The solution that worked for me was to select all fonts in the FontBook application, and click EDIT>SELECT DUPLICATE FONTS
    Once selected, I simply disabled all of them... hey presto I can now, use shortcut keys for Bold and Italics in Mail.
    Hope it helps
    Matt

  • To dynamically  generate text box using javascript

    hi...
    i want to have a button such that if he clicks that button 2 textboxes be generated side by side.
    i want the textboxes to be added just above the button so that the button is always below the newly created textboxes.
    its not only once i want this ..i want that whenever he clicks the button 2 textboxes gets added everytime...
    how can i achieve this?
    thanks

    Ok, so this is a complete thread hijack - probably would have been worth a new thread.
    The initial solution involved javascript completely.
    The problem breaks down to
    1 - identify when we should move focus
    2 - identify which field focus should move to.
    Here is one version. This approach gives each textfield an individual name/number so you can find its "matching" pair.
    <html>
    <head>
      <script>
      var numLinesAdded = 0;
      function focusNext(tBox){
        var name = tBox.name;
        var index = name.substring(name.indexOf('_')+1);
        var brother = eval("document.all.txt2_" + index);   
        var l = tBox.value.length;   
        if (l >= tBox.maxLength){
          brother.focus();
         function generateRow() {
         var d=document.getElementById("div");
         d.innerHTML+="<input type='text' maxlength='5' name='txt1_" + numLinesAdded + "' onkeypress='focusNext(this)'>";
         d.innerHTML+="<input type='text' name='txt2_" + numLinesAdded + "'><br>" ;
         numLinesAdded++;
    </script> 
    </head>
    <body>
    <form>
    <div id="div"></div>
    <input type="button" value="Add" onclick="generateRow()"/>
    <input type="submit">
    </form>
    </body>
    </html>

  • Can I as a webdeveloper deselect 'zoom only text' programmatically using javascript or another programming language? I want the background images to zoom in also when someone zooms in on a page even when he selected 'zoom only text'.

    see question

    A good place to ask questions and advice about web development is at the mozillaZine Web Development/Standards Evangelism forum.<br />
    The helpers at that forum are more knowledgeable about web development issues.<br />
    You need to register at the mozillaZine forum site in order to post at that forum.<br />
    See http://forums.mozillazine.org/viewforum.php?f=25

  • Random text with links using Javascript?

    I have a very simple script I downloaded that makes text random using javascript. I would like to add a hypertext link on parts of the text, but can't seem to get it to work.
    Would anyone be so kind as to show me how this can be done. I would like to add links to the "Random text string 1.", Random text string 2. etc., within the javascript below.
    <SCRIPT LANGUAGE="Javascript"><!--
    function text() {
    text = new text();
    number = 0;
    // textArray
    text[number++] = "Random text string 1."
    text[number++] = "Random text string 2."
    text[number++] = "Random text string 3."
    text[number++] = "Random text string 4."
    text[number++] = "Random text string 5."
    // keep adding items here...
    increment = Math.floor(Math.random() * number);
    document.write(text[increment]);
    //--></SCRIPT>
    Thank you!

    Hi, Mic,
    I actually don't know if this will work, but what if you added <a href> coding around your text line? You might need \ escape characters so that your script sends it out without trying to execute it as code.
    Z

  • Using JavaScript to set value of Spry validated text field

    Why can't the value of a text field be set using JavaScript
    when it's validated using the Spry validation widget.
    Example (this works):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <input type="text" name="birthdate" id="birthdate"
    value="">
    Example (this doesnt work):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <span id="birthdate">
    <input type="text" name="birthdate" id="birthdate"
    value="">
    <span class="textfieldRequiredMsg">please enter your
    birthday</span>
    </span>
    <script type="text/javascript">
    <!--
    var birthdate = new
    Spry.Widget.ValidationTextField("birthdate", "none");
    //-->
    </script>
    Is there a way to change the value of a Spry validated text
    field using JavaScript?
    Thanks.

    Why can't the value of a text field be set using JavaScript
    when it's validated using the Spry validation widget.
    Example (this works):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <input type="text" name="birthdate" id="birthdate"
    value="">
    Example (this doesnt work):
    <select name="birthdate_month" id="birthdate_month"
    onChange="document.getElementById('birthdate').value = 'test';">
    <option>1</option>
    <option>2</option>
    </select>
    <span id="birthdate">
    <input type="text" name="birthdate" id="birthdate"
    value="">
    <span class="textfieldRequiredMsg">please enter your
    birthday</span>
    </span>
    <script type="text/javascript">
    <!--
    var birthdate = new
    Spry.Widget.ValidationTextField("birthdate", "none");
    //-->
    </script>
    Is there a way to change the value of a Spry validated text
    field using JavaScript?
    Thanks.

  • Captivate: Using Javascript to show/hide text captions

    Hello,
    I want to show/hide a text caption using javascript. I can't find the way of doing it with advanced actions. I dont know if it's because it belongs to a question slide in a pool. Does somebody knows if it's possible and how it can be done??

    You can set the length of the variable when you insert it.
    15 characters is just the default setting.
    What I meant by COULD is that the kind of thing you are asking about here (using JavaScript to hide objects inside a Captivate movie at runtime) is not as simple as you'd like it to be.
    JavaScript is not my particular area of expertise, but there are some people that chime in on this forum that ARE experts at JS. But I think they would also be the first to say that it's not as simple a thing to pull off as just "knowing the command to hide/show an object".
    The easiest tool to use in Captivate for showing or hiding objects is Advanced Actions.  The next easiest thing to use is ActionScript 3, and that's hard.  JavaScript is a very useful programming language, but it spends all of its life outside the Captivate movie looking in through AS3's External Interface.  So JS alone is not going to solve all your issues.

  • Adding current date to text field w/ Javascript in Acrobat 8

    I am trying to add the current date to a text field using javascript in Acrobat 8 Professional. I am using the util.printd function in a javascript function but the date of creation shows in the text field, NOT today's date. Any clues??
    var f = this.getField("myField");
    if (!f.value) f.value = util.printd ("m/d/yyyy", new Date());

    Thanks. I've used it also without the empty value check and had the same result of showing the creation date and not the current date.

  • Lock/Disabled/Readonly Element using Javascript

    hi,
    how to lock or disabled or make readonly element using javascript in APEX 3.2
    i need to lock/readonly popup element in the form
    CAN ANYONE HELP ME?

    A little complex, so possibly there will be a simpler solution than this.
    Immediately following the readOnly statement enter this code
      $x('P60_NAME').readOnly="readOnly";
      latag = $x('P60_NAME_holder').getElementsByTagName('A');
      for (i=0;i < latag.length; i++){
         latag.removeAttribute('href');
    This code removes the HREF attributes from the Image anchor.
    This should fix it.
    Regards,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • How to get text from column  labels in pivot using javascript?

    Hi, is it possible to get text from column labels in pivot using javascript? How?

    You don't get a response from a URLRequest, you get the response from a URLLoader:
    View this sample page for URLRequest and URLLoader and I think it'll make more sense to you.
    http://help.adobe.com/en_US/air/reference/html/flash/net/URLRequest.html#URLRequest()

Maybe you are looking for

  • Outlook 2013 Won't Display My Archived Mail PST Files

    Hi there, I have recently upgraded to Outlook 2013 from 2010. I have archived mail in PST files going back many years. I managed to open the first one I tried (Outlook 2003 archive) but noticed it wouldn't display sent items on a common search. I the

  • Podcast jumps during playback on computer.

    Greetings from Biloxi, My podcast playback jumps after a few minutes of playback. The player moves through the list of downloaded podcast until it reaches the first one on the list. Then it plays for about 4 minutes and stops playing. I have to hit r

  • How to find out if I have Solaris v11.0 or v11.2? Where is 64bit Solaris?

    How can I find out if I have Solaris v11.0 or v11.2 installed? Does Solaris "2010.11"  mean  Solaris 11 or Solaris 10? Assume I have installed Solaris 10 or Solaris 11.0: Can I update Solaris with the integrated Update Manager to Solars 11.2 or do I

  • Backup Problem LTO & Tivoli.

    Dear Guru's, I have again into a problem with our SAP Production backup. We have two backups regularly running in the system, following are the details : Single Cartridge LTO : Offline. Tivoli Backup :  Online. The error is (It is same for both the c

  • Is it possible to export the html code from a muse site that I am building?

    Is it possible to export the html code from a muse site that I am building?