Home Advanced Request Offering
Options

How to add placeholder text to text fields

Does anyone have a way to edit the placeholder text of a text box? I know you can do this for create request on behalf of, but I would like to be able to add placeholder text on any text box for any ARO.

Thanks

Answers

  • Options
    Morten_MeislerMorten_Meisler Premier Partner Advanced IT Monkey ✭✭✭
    What do you mean by placeholder text?
  • Options
    Larry_EllisLarry_Ellis Customer IT Monkey ✭
    Text that goes in the text box that is grey and shows the user a hint for what they should type in. It disappears once the user starts typing in the box. The created on behalf of text field has this feature 
  • Options
    Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    It seems that this is not even a feature available in the Kendo UI, so it would be next to impossible to implement at this time, even with help from Cireson.
  • Options
    Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    Actually, I take that back. I just messed around with it a bit, and just by adding 'placeholder="something"' to the <textarea>-tag, it displays the text as a placeholder. Now the real challenge is to actually use a label as a placeholder instead of as a label above the textarea. I guess it should be possible by getting each label of class "control-label" and checking if the next element is a div of class "form-group" and that contains a textarea. If it does, copy the content of the label, hide the label, and add a new attribute to the textarea element with the content from label as value.

    It's probably not something I will do, as it seems like the complexity will be to high, and I doubt it will be very robust, but I'm always happy to be proven wrong!
  • Options
    Konstantin_Slavin-BoKonstantin_Slavin-Bo Customer Ninja IT Monkey ✭✭✭✭
    edited May 2017
    After seeing what John Doyle did with the query picker, I think this would be reasonable to add to that toolbox. How should it work, though? Should the "title" of the prompt to be the placeholder (i.e. the actual title will be removed above the prompt), or should it be possible to define a placeholder different from the title, and the title remain above the prompt?
  • Options
    Michael_CananMichael_Canan Customer IT Monkey ✭
    var resultContainer = $(document).find("div[class='row question-container'] > :contains(" + label + ")");
    var resultObj = resultContainer.find('textarea');
    //hint is what will be the placeholder ex: var hint = "XXX-XXX-XXXX"
    $(resultObj).attr('placeholder', hint);//Label is the title of the question ex: var label = "Enter your phone number"
    


Sign In or Register to comment.