Can i add content to text editor depends on selected?

i created a custome doctype for marketing plan
and i have boilerplates or templates what ever we call it its just an excel with templates for diffrents Plans
i want to add this plans in select field i want when user select an option
auto add the template in the text field

any help ?
i want if user select onw of options in select Field Auto add content to the text editor depends on what user select


So if I understand you have created a custom doctype which have a dropdown/select. When the user select one of the options available, you want to populate what exactly? the excel or the doctype?
Why don’t you create a doctype to store the data that you have in your excel in the system instead? It would make more sense I think. From there, your problem becomes really easy to solve.


thanks for your replay,
i’ll explain more
i have more thank 60 templates like this

and i’ve alreday recreated them in html and now users copy desire template code from txt file to the new document in the custom doctype
i want to make this easire thank coping code and past it
i want when user select which template he will fill it automaticlly erpnext add the code to text editor ?
did you get it ?

i think i can make it with Javascript But
how to check which select option is selectet ?

I recomend you to do this:

  • A custom doctype called “Marketing Plan Template” with a name and a field where you put the HTML called template_html
  • A Link to this new doctype in your “Marketing Plan” called template
  • In the options of your “Marketing Plan” html field, you add this: template.template_html

If you do this correctly, when you select a template, the HTML field should auto complete.

EDIT: I did not read the @mel_erp answer, is almost what she said.

Hi @Nahuel_Nso, can you also help me with my concern. I create a new doctype same as what the function of Terms and Conditions Template does. (on Selling Module)

So it is some what a duplicate of it. However the jinja code is not working on the text editor of the new doctype.

What should I do to make the jinja code work on the new doctype which is working on the Terms and Conditions Template doctype?