Insert breaks in a Multiple lines of text field control

Hello,

I have a Multiple lines of text field:
fd.field("PersonFullAddress").value

i am filling this multiple line control from different controls in order to merge and get full info:
fd.field('PersonVillageID').value.VillageName
fd.field('PersonCazaID').value.CazaName
fd.field('PersonProvinceID').value.ProvinceName
fd.field('PersonPOBox').value
etc....

    function FncSetFullAddress() {
       fd.field("PersonFullAddress").value = fd.field('PersonVillageID').value.VillageName + ", " +
       fd.field('PersonCazaID').value.CazaName + ", " +
       fd.field('PersonProvinceID').value.ProvinceName + ", " +
       fd.field('PersonPOBox').value;
    };

Result:
Halat, Jbeil, Mount Lebanon, etc.....

My need is to insert break (New line ) instead of space (+", "+ ) after each control value
how to insert break (New line) after each value?
The result will be like this:
Halat
Jbeil
Mount Lebanon
etc.....

Thank you

Hello @gkhadra,

Yes, you can add breaks in multiple lines of a text field. Please do the following:

  1. Enable enhanced rich text option in the field's settings.
    image

  2. Replace ", " in your code with '<br/>'

1 Like

Dear @mnikitina

Kindly in the same multiple lines of text field how to set by default the text alignment to right or rtl?

@gkhadra,

In a multiple-line text field with the enabled enhanced rich text option text aligns the same way as in HTML: style="text-align:right;"

The code to align text to the right will be as follows.

    function FncSetFullAddress() {
       fd.field("PersonFullAddress").value = '<div style="text-align:right;">' +
       fd.field('PersonVillageID').value.VillageName + ", " +
       fd.field('PersonCazaID').value.CazaName + ", " +
       fd.field('PersonProvinceID').value.ProvinceName + ", " +
       fd.field('PersonPOBox').value + '</div>';
    };
1 Like