How to pre-fill description box based on Custom Field value

3 Kommentare

  • Trapta
    Community Moderator

    Hi Patrick Lieu,

    Try the below code:

    tinymce.get("request_description").setContent("<p>Description 1</p>");

    Let me know how it goes for you. You can also take a look at this post.

    Thanks

    0
  • Lou

    When you say description, are you referring to the subject field? If so, we use a trigger and extension to make that change. It's completely automated based on if the field has a value.

    0
  • Ifra Saqlain
    Community Moderator

    Hi Patrick Lieu,  I got something for you:

     

    HTML: Add at any page

    <div id="option1" class="group">Description One</div>
    <div id="option2" class="group">Description Two</div>
    <div id="option3" class="group">Description Three</div>
    <div id="option4" class="group">Description Four</div>
    <select id="selectMe">
    <option value="option1">option1</option>
    <option value="option2">option2</option>
    <option value="option3">option3</option>
    <option value="option4">option4</option>
    </select>

     

    Script code:

    $(document).ready(function () {
    $('.group').hide();
    $('#option1').show();
    $('#selectMe').change(function () {
    $('.group').hide();
    $('#'+$(this).val()).show();
    })
    });

     

     

    Output is:

     

    I'm not sure but may be you can do something with this code via changing the classes in script code.

    You can add script code only and add the classes of your custom dropdown.

    Thanks

     

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Powered by Zendesk