Gossamer Forum
Home : Products : DBMan : Customization :

help with tabs in textarea

Quote Reply
help with tabs in textarea
I have someone who is entering some poems into a database and the poems have formatting that requires using tabs for spacing.

I'm having him enter the indents using       for each tab, but it's not storing it within the database so when he goes to modify the record the   codes are not showing and then once the modify is complete it takes away all those codes (unless they are added again for each line).

Is there an easier way to add just a tab code and have that code stored in the database so that it will not be lost when you modify a record.

And then just tell the script to replace that code with a certain number of spaces (say 5).

I know that /t = tab but I'm not sure if that can be added into a textarea?

Any help for an easy solution would be appreciated.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] help with tabs in textarea In reply to
You should be able to use [tab] where you want the tab and then in sub html_record, right at the beginning, use something like

$rec{'textarea"} =~ s/\[tab\]/     /g;

The Perl code works and I don't think there'll be a problem with html. The only problem might come in the sub parse form, but I don't think it will.

I also tried using \t (actually typing it out, not using the tab key) and it worked. The subsitution is just

$rec{'textarea"} =~ s/\t/     /g;

It might even work if you just used the tab key, but I couldn't get it to when I ran a Perl script.

Even though it's more typing, somehow I would find it easier to type in [tab] than \t. I'd always forget whether I was supposed to use a \ or a /. :-)


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Quote Reply
Re: [JPDeni] help with tabs in textarea In reply to
Thank you very much, I'll give it a try and see how it goes.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] help with tabs in textarea In reply to
What ended up working for me was using the [tab] within the records for tabs and then replacing in the display using:

$rec{'Desc'} =~ s/\[tab\]/     /g;

I couldn't use the tab key or it would just pop to the next field entry :)

Seems to be working just fine. Thanks again :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/