How to populate a textarea (medium-editor) with content from a variable

I have a variable ‘list_replace’ which is populated dynamically and typically looks like this

  • list_replace: “Repeater lamp, Headlamp, Stop/driving lamp, Screen Pillar”

Now I want to populate a textarea (medium-editor) with the content from the variable, but I can’t get it to work.

If I try to populate a standard text input, then I can get a result.

I know textareas are slightly different but I’m not sure what to do here.

Hello,
It works with Dynamic Attributes > Input > Value and there select the variable value.

Hi @Teodor, thanks for the reply but it only works for the INPUT, and not the TEXTAREA

<textarea id="inp_meth_replace" class="form-control" is="dmx-medium-editor" name="meth_replace" aria-describedby="inp_meth_replace_help" placeholder="Replace" dmx-bind:value="mod_select_carparts.form_job_update.data.list_replace"></textarea>

<input id="text1" name="text1" type="text" class="form-control" dmx-bind:value="mod_select_carparts.form_job_update.data.list_replace">

It might be worth checking the order of the .js files:

image

Wappler sometimes adds them in the wrong order.

I tested this locally and it works perfectly fine.
Check your browser console for errors.

@Teodor and @TomD,

I have no errors.

I do have a number of warnings related to formatNumber (which I know about) and plently of Violations which Patrick in the past has told me to ignore.

image

I had a quick look at the order of the JS files as mentioned by Tom, which did give some odd results!

If I change the order then I do get text appearing in the textarea, BUT I also get a second textarea appearing.

and when I look at the code in DevTools it looks like this

I would also check that bootstrap.min.css appears above the medium editor files.

@TomD It was below, so I moved it above. It didn’t make any difference :frowning:

Are you quite sure the files appear in this order:


or at least the css and js files are in this order, relative to each other (I usually group the different types)?

If so, I would save again, restart Wappler, flush brower cache etc… If it still doesn’t work, perhaps there’s something else on the page causing the problem.

This is the order of my files now, which also includes “dmxMediumEditorImageUpload”

	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
	
	<link rel="stylesheet" href="../dmxAppConnect/dmxMediumEditor/dmxMediumEditor.css">
	<script src="../dmxAppConnect/dmxMediumEditor/medium-editor.js" defer=""></script>
	<script src="../dmxAppConnect/dmxMediumEditor/dmxMediumEditor.js" defer=""></script>
	<link rel="stylesheet" href="../dmxAppConnect/dmxMediumEditor/medium-editor.css">
	<link rel="stylesheet" href="../dmxAppConnect/dmxMediumEditor/themes/default.css">
	
	<script src="../dmxAppConnect/dmxMediumEditorImageUpload/dmxMediumEditorImageUpload.js" defer=""></script>
	<link rel="stylesheet" href="../dmxAppConnect/dmxMediumEditorImageUpload/dmxMediumEditorImageUpload.css">

Guys, this (files order) has nothing to do with the issue reported here.
@UKRiggers as I explained, I tested this and it works fine. Can you please provide a link where we can check what’s going wrong?

The issue with the order of files has cropped up a few times - and is still an issue. When @UKRiggers changed the order, the text appeared in the textarea (where it had not before).

The second textarea is also an issue which has been mentioned before (and resolved by reordering the files). It seems the issue in this case is something different.

I am referring to the initial issue reported, Tom.
This has not to do with files order.

I just tested it - populating a medium-editor textarea with a variable (the initial issue).

It works fine with the correct file order; if I reverse the order of the js files in my screenshot, it doesn’t work. This was @UKRiggers’ experience too. I appreciate there are other issues.

There will be errors in the console :slight_smile:

Sent you a PM :slight_smile:

1 Like

A post was split to a new topic: Medium editor wrong includes order