how to set value with html tag

Hi,

 

I would kindly ask your support.

In my model I have a string html formatted like this:

 

string ao_RequestInfo = "<b>Inserted by: </b> user <b> on </b> 29/09/2020 </br><b>Reason: </b> xxxxxx"

 

in my view:

 

<ejs-textbox id="ao_RequestInfo"

                                               multiline="true"

                                               readonly="true"

                                               floatLabelType="Always">

</ejs-textbox>

<ejs-multiselect id="so_OtherOperation"

                                                               dataSource="@Model.StandardOperations"

                                                               mode="Box"

                                                               allowFiltering="true"

                                                               filtering="onfilteringOtherStandardOperation">

                <e-multiselect-fields text="so_Name" value="so_ID"></e-multiselect-fields>

</ejs-multiselect>

 

 

 

I would give the previous string as a value of a multiline textbox, on page load AND, always on page load, I would prefill the multiselect with some values from my model but I see only the last one

(I'm not able to push the value in the multiselect)

 

<script>

window.onload = function () {

[....]

 

                document.getElementById("ao_RequestInfo").ej2_instances[0].value = Mymodel.ao_RequestInfo;

 

    var txt;

    txt =    document.getElementById("ao_RequestInfo").ej2_instances[0].value;

    document.getElementById("ao_RequestInfo").innerHTML = txt;

 

[...]

        var i;

 

        for (i = 0; i < myModel.otherOperationList.length; i++)

        {

            document.getElementById("so_OtherOperation").ej2_instances[0].text = myModel.otherOperationList[i].addItem;

        }

</script>

 

Thanks a lot


1 Reply 1 reply marked as answer

SP Sureshkumar P Syncfusion Team October 9, 2020 02:36 AM UTC

Hi Gabriele, 
 
Greetings from Syncfusion support. 
 
We have restricted the HTML code sanitizing for some security purpose. So, the given string updated as value of the multiline textbox component.  
 
Please find the out put here:  
 
 
Regards, 
Sureshkumar P 


Marked as answer
Loader.
Up arrow icon