Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Paragraph breaks in textarea field only for preview page generated by CGI::Formbuilder

by matthewb (Curate)
on Jun 14, 2004 at 13:39 UTC ( #366536=note: print w/replies, xml ) Need Help??


in reply to Paragraph breaks in textarea field only for preview page generated by CGI::Formbuilder

I don't think that you are right to be attempting to solve this problem `in Formbuilder'. That you seek to affect the display of your data alone (preserving the actual data as-is) strongly suggests that the solution may best be part of your display logic.

A solution is, in fact, provided by the Template Toolkit in its built-in html_para_break() filter. Since, however, you say you are using HTML::Template I suggest that you could do a lot worse than looking at the TT2 solution and seeing what you can learn (or pinch!) from it.

MB
  • Comment on Re: Paragraph breaks in textarea field only for preview page generated by CGI::Formbuilder
  • Download Code

Replies are listed 'Best First'.
Re^2: Paragraph breaks in textarea field only for preview page generated by CGI::Formbuilder
by AJRod (Scribe) on Jun 15, 2004 at 04:51 UTC

    Thank you for broadening my already becoming myopic focus on Formbuilder as the locus of the solution.

    Do you know of a way I can accomplish your suggestion using HTML::Template? I don't know enough of it yet but I'm willing to squeeze what time I have to learn from Template toolkit, though it will take a long time, and longer perhaps to advocate its use by our people at IT or even by other hosts. Not to mention that proposing it will rock the boat of designers here who are already familiar... correction... who have already sedentized their mindset into HTML template.

    Actually, I already made one attempt, at least, in the area of display logic. In the template, I used a <pre> tag to surround the field value. It preserved my data but its display differed from one browser to another, depending on whether they support the deprecated width property of <pre> or not. Does this confirm my growing realization that this and similar moves lead to a dead end as well?

    I know that this was not the solution you were suggesting, I was just musing on alternative rays of light which the erstwhile "forbidden" TT2 offers with its very tempting html_para_break() filter. (Musing also if this view is an excuse for my laziness.)

    Hoping these meditations are not yet too much for you.

    Tata.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://366536]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2020-09-18 14:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (112 votes). Check out past polls.

    Notices?