How do I change the description field text / help-text based on form type, and also has multi-language support?

Answered

1 Comments

  • Ifra Saqlain
    Community Moderator
    Zendesk Luminary
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Raj Agarwal,

    I think this code will be helpful for you:

      var htmllang = document.documentElement.lang;
      
      // Form One 
      if (htmllang === "en-US") {
      if(window.location.href.indexOf('00000')>0){
          document.querySelector('h1').innerText = "Title Name";
          document.querySelector('#request_description_label').innerText = "You Text Based On Different Forms";
        }
      } 


    // Form Two
    if (htmllang === "da") {
      if(window.location.href.indexOf('11111')>0){
          document.querySelector('h1').innerText = "Title Name";
          document.querySelector('#request_description_label').innerText = "You Text Based On Different Forms";
        }
      }

     

    en-US - Language symbol

    00000 - Form ID 

    Title Name - Remove this title and write new one

    You Text Based On Different Forms - Description field title, remove it and write yours

     

     

    0

Please sign in to leave a comment.

Powered by Zendesk