Gossamer Forum
Home : Products : DBMan : Customization :

TEXTAREA input output problem

Quote Reply
TEXTAREA input output problem
I discovered a problem of beauty.

In my form definitions I am using the following line in order to define an input field for a text area:

<TEXTAREA NAME="Text" ROWS="$rows" COLS="$cols" WRAP="VIRTUAL" MAXLENGTH="2500">$rec{'Text'}</TEXTAREA>

While feeding the text area with text I define the optics of my text with pressing the ENTER key on my computer sever times. But unfortunately when I display the result of the input into the text field I do not see the optics I defined any more because the whole text appears without any structure.

Do I have to use another tag or do I have to use another parameter for this tag or do I have to use a number of TEXTAREA tags in order to give a nice optics to the output.


Sincerely michaels


Quote Reply
Re: TEXTAREA input output problem In reply to
If i understand your question correctly, the answer is you would need to define your page layout outside of the actual fields.

Perhaps if you provided an example of how you want your output to appear?



Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: TEXTAREA input output problem In reply to
If I understand you correctly, the following FAQ will answer your question --

http://www.gossamer-threads.com/...s/Detailed/1035.html

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: TEXTAREA input output problem In reply to
Hi Carol, do you know of anyway to maintain line spacing on the Ext Text Mod? I tried the suggestion you offered above, :-( didn't work.
my (%rec) = @_;
$rec{'text'} =~ s/\n/<BR>/g;

I also have user_friendly and short/long installed. Thanks so much!


Quote Reply
Re: TEXTAREA input output problem In reply to
Try

$rec{'text'} = join "<BR>",@text;

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: TEXTAREA input output problem In reply to
Hi JPD,

Having noticed the similarity of the code you posted with a line in the External Text Mod, I opted to try adding the BR tag between the empty ""'s in the code added to html.pl.

IT WORKED!

If this is not the correct place, please let me know.
Original:
Code:
$rec{$db_key} =~ s/<?.B>//g;
open (TEXT, "<$save_text_dir/$rec{$db_key}.txt") or &cgierr("error in displaying record. unable to open text file $save_text_dir/$rec{$db_key}.txt\nReason: $!");
@text = <TEXT>;close TEXT;$rec{'text'} = join "",@text;
Changed to:
Code:
$rec{$db_key} =~ s/<?.B>//g;
open (TEXT, "<$save_text_dir/$rec{$db_key}.txt") or &cgierr("error in displaying record. unable to open text file $save_text_dir/$rec{$db_key}.txt\nReason: $!");
@text = <TEXT>;close TEXT;$rec{'text'} = join "<BR>",@text;
The instructions at:
http://www.jpdeni.com/...Mods/externaltxt.txt

Carol, thank you so much for all your help and guidance! PS - that genealogy db mod would be of huge interest to many of us.


Quote Reply
Re: TEXTAREA input output problem In reply to
That's exactly the place to put it. Smile

The genealogy mod (if I ever get it written) will be for DBMan-SQL (if I ever get it figured out). Smile

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: TEXTAREA input output problem In reply to
Yes the example should clarify the problem. So I enter the following into the textarea field:

Hi, my name is michaels.(here I press the enter key)
I am working with dbman.(here I press the enter key)
See you soon(here I press the enter key)
michaels

But the output produces:
Hi, my name is michaels. I am working with dbman. See you soon michaels

Does that usually unfriendly output always happens? In the preview of this forum it does not happen!

michaels


Quote Reply
Re: TEXTAREA input output problem In reply to
Are you using the external text mod? Or are you just using a textarea?

If you're using the external text mod, you need to change

$rec{'text'} = join "",@text;

to

$rec{'text'} = join "<BR>",@text;

If you're using a textarea, with the data going into your .db file, in sub html_record, after

my (%rec) = @_;

you need to add

$rec{'FieldName'} =~ s/\n/<BR>/g;

where FieldName is the name of the field you want to change.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: TEXTAREA input output problem In reply to
I am using textarea.

Thank you so much

michaels

Quote Reply
Re: TEXTAREA input output problem In reply to
HI
I am using the textare.

Many thanks for the information - it works fine !

But it does not accept a line break at the beginning of the text or at the end. Is that something that can be solved?

Sincerely Michael

Quote Reply
Re: TEXTAREA input output problem In reply to
Hello Michael, if you are wanting the blank line spacing before and after your textarea to make the layout more effective visually, simply add the tags before and after the textarea call.

<TR><TD>&_nbsp;<BR><$font>$rec{'TEXTAREA'}</font><P></TD></TR>

This will add a blank line above and below your TEXTAREA field content. Be sure to replace TEXTAREA with your actual fieldname.

You'll need to use the &_nbsp;<BR> because, by default, the text will move to the top of the data cell unless there is "content" forcing it to position downward. The blank space will simulate content on the "first line" allowing the move to the <BR>

Be sure to remove the underscore _ which I had to use so the code would display.


Quote Reply
Re: TEXTAREA input output problem In reply to
Many thanks for the fast reply!

I understand the solution and I was already choosing it for my problem.

My question was related to having a bit more flexibility by means of controlling the top and bottom distance of the textarea from other output by the content of the textarea.

Sincerely MIchael