Page 1 of 1

Fit an entire paragraph in a display field

Posted: Thu Jan 16, 2025 2:43 am
by cuadradoja
Hi...

I want to show in a form, the content of a text field (paragraph) from another table using a display type field. The issue is that when I perform a SQL query only the initial part of the paragraph is displayed since the width of the display field is narrow but with a height wide enough for the text to fit vertically to it. I've made several attempts at properties applying CSS to make all the text content fit into the container, but I haven't been able to achieve anything.

I need some help with this please... :roll:

Re: Fit an entire paragraph in a display field

Posted: Thu Jan 16, 2025 10:58 pm
by steven
Hi cuadradoja,

Are you wanting the text to wrap inside your display object?


Steven

Re: Fit an entire paragraph in a display field

Posted: Fri Jan 17, 2025 3:44 am
by cuadradoja
Hi Steven,

That's right, I really don't know how to do it...

Re: Fit an entire paragraph in a display field

Posted: Fri Jan 17, 2025 7:35 am
by kev1n
A display field (which is a HTML input type element) is meant for single-line text. Since you're working with paragraphs, consider assigning the text to textarea or div.

Re: Fit an entire paragraph in a display field

Posted: Fri Jan 17, 2025 10:57 pm
by steven
Hi cuadradoja,

As Kev mentioned HTML input elements don't format the way a textarea does.

Here is a bit of a Hack...

Put this on the onclick of this button

Code: Select all

$('#jok_from_display').val($('#jok_display').val());
It doesn't reformat it the same but at least you see everything.

(or download tha attached db)

d2.png

display_textarea.zip


Steven

Re: Fit an entire paragraph in a display field

Posted: Sun Jan 19, 2025 10:40 pm
by cuadradoja
My friend... you're the best!!!

It works perfectly for what I'm trying to do.

Thank you very much for your valuable advice :thumb: