Home > visualforce > Placeholder for RichTextarea

Placeholder for RichTextarea

June 12Hits:8
Advertisement

Displaying placeholder text for rich Apex:inputTextArea is not working when I use pass through variable in vf page.

Has anybody achieved using JavaScript or any other method to display placeholder.

Much appreciated.

Thanks Sivarajan

Answers

Please can you clearly explain the question. You may use apex:inputTextArea html-placeholder="TextYouWantToEnter" apex:inputTextArea so as to display the placeholders in inpuTextArea.

If you want to use html attributes in apex components, you need to use html-[attribute name]

Below code worked for me:

<apex:page controller="TestController">
    <apex:form id="changeDescription">
    <apex:pageBlock>
        <p>Current description: </p>
        <p>Change description to:</p>
        <apex:inputTextarea id="newDesc" value="{!test}" html-placeholder='Placeholder here'/><p/>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Reference: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_html_features_pass_through_attributes.htm

Related Articles

  • Placeholder for RichTextareaJune 12

    Displaying placeholder text for rich Apex:inputTextArea is not working when I use pass through variable in vf page. Has anybody achieved using JavaScript or any other method to display placeholder. Much appreciated. Thanks Sivarajan --------------Sol

  • Placeholder after not working in IE 11 and firefox 43 April 6

    I am trying to use the :after CSS pseudo-element on an input field, but it does not work. If I use it with a span, it works OK. <style type="text/css"> .mystyle:after {content:url(smiley.gif);} .mystyle {color:red;} </style> This wor

  • How can I create a text box in a PowerPoint slide that formats bullets just like a placeholder?

    How can I create a text box in a PowerPoint slide that formats bullets just like a placeholder?September 23

    I've noticed that if I edit a slide master in PowerPoint, I can insert a special kind of text box called a "placeholder". With placeholders, I can easily create nice looking multi-level bulleted outlines. What's bothering me is that I don't seem

  • How in master page to show/hide placeholder based on page layout content type?January 18

    How is the best approch to show / hide place holders which are in the Master Page based on which content type the Page Layout is associated with? In the design we have a right placeholder for all article page layouts, but for start pages which are as

  • Featured image/thumbnail fallback placeholder imageMarch 14

    I'm currently using the_post_thumbnail(); to display featured images in my pages. Is it possible to set a fallback placeholder image in the event a featured image hasn't been set? --------------Solutions------------- You can use has_post_thumbnail()

  • How can I set a placeholder variable in page.tpl.php from a page callback?April 28

    I have a value in page.tpl.php that I would like to set in page callbacks, independently from the main content. In page.tpl.php: <?php print $placeholder ?> <?php print render($page['content']); ?> What I would like to do in the page callback:

  • Enable dragging of image placeholder(?) in Windows 7, Word 2010

    Enable dragging of image placeholder(?) in Windows 7, Word 2010May 19

    It could be a text box, or an image. I click on it and attempt to drag it to a new location, but I can't determine exactly where I'm placing it because Windows does not show me an outline of the image after I begin dragging it. So, I have to keep mov

  • How to show a placeholder instead of an equation?June 7

    I am looking for functionality similar to the endfloat package but for equations. Instead of displaying an equation I would like to display a placeholder such as [equation 1 here] Does anyone know of such a package? --------------Solutions-----------

  • placeholder text in category form labelJuly 20

    Is there a way to put a placeholder text in the category form label? Right now the label is empty and has a dropdown menu filled with categories. I want to make a dummy placeholder text which will be something to : CHOOSE THE CATEGORY! <option value=

  • On forms, is inline placeholder text better than a label outside each field?

    On forms, is inline placeholder text better than a label outside each field?July 21

    I am familiar with research on label placement to the left or above. I tend to go with right justified with the label to the left of the field for my form designs. However, inline placeholder text is trending and it does further reduce page clutter.

  • Center HTML Input Text Field PlaceholderSeptember 11

    How can I centre the input field's placeholder's alignment in a html form? I am using the following code, but it doesn't work: CSS -> input.placeholder { text-align: center; } .emailField { top:413px; right:290px; width: 355px; height: 30px; position

  • Add content to a masterpage placeholder in a specific site templateSeptember 25

    I have a master page which is a customized copy of v4.master. I want to add some content to a the placeholder called PlaceHolderQuickLaunchBottomV4: <SharePoint:UIVersionedContent UIVersion="4" runat="server" id="PlaceHolderQui

  • Adding HTML5 placeholder to all drupal forms

    Adding HTML5 placeholder to all drupal formsOctober 6

    I'm trying to add the placeholder attribute to all textfields across my website, but I'm having no luck. I've created a module that overrides hook_form_alter function mymodule_form_alter(&$form, &$form_state, $form_id) { foreach ($form as $key =&g

  • How to add placeholder into webforms

    How to add placeholder into webforms October 6

    I'm trying to add the placeholder attribute to all textfields across my website, but I'm having no luck. I've created a module that overrides hook_form_alter function mymodule_form_alter(&$form, &$form_state, $form_id) { foreach ($form as $key =&g

  • Javascript Placeholder PolyfillNovember 8

    I was wondering if you could review the following code I've written as a polyfill for the placeholder attribute in HTML5? The object of the polyfill is to replicate the functionality of the placeholder attribute. In effect, the polyfill is supposed t

  • Drupal 7: hook for comments placeholderDecember 7

    How can i implement a hook in my theme template that will display a placeholder in my comment box? I am using drupal 7 and zen sub theme. Thank you, in advance. --------------Solutions------------- You could use the hook_form_FORM_ID_alter to modify

  • How to show static placeholder when less post elements in archive page?December 10

    I'm doing an archive page for a theme that will contain only images thumbnails. The maximum amount of thumbnails that the page layout can contains is 12. So as query I would like to been able to get two different results. If there is 12 thumbnails, s

  • Image placeholder in firefoxJanuary 7

    Sometimes I use a mobile connection when I travel; if I connect in an area which is not covered really well by mobile networks, I run into issues. I tried to disable the loading of images from the preference panel. The problem is that Firefox does no

  • Replacing a placeholder term with a session variable value in taxonomy filterJanuary 10

    I have in my themes some code which will set a session variable. For the sake of example, it's a geolocation routine which will set to either USA, UK or ROW, resulting in: $_SESSION['region'] = 'USA'; and I have a custom taxonomy of 'regionok' which

  • UserControl inside Placeholder good/bad? + Postback problemJanuary 13

    Currently I'm working a bit with ASP.NET and trying to find the best way to navigate through pages. Right now I have an UpdatePanel which has a Placeholder inside it. This Placeholder will then add the usercontrol I need. I've been looking around on

Copyright (C) 2018 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.531 s.