Re: Problem in TMPL_VAR Display : String containing space is not displayed

Carl Franks <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
On 07/11/05, Rakhi Verma <[email protected]> wrote:
>
> Hi,
>          I am facing some problem with the output of TMPL_VAR VALUE when
> the VALUE text contains space charater e.g "abc efg".
>  When the template is output the <TMPL_VAR> is not replaced with the VALUE
> text i have specified.
> Only the value before the space i.e "abc" is displayed.
>
>
> "test.tmpl" file contains this line:
>
> <input maxlength="50" name="name" value=<TMPL_VAR NAME=cust_name>
>
>
> "test.pl" script contains this code:
>
> my $template = HTML::Template->new(filename => test.tmpl);
> $template->param(cust_name => "Deepak Puri");
>
>  my $value = $template->param('cust_name');
>
>
> $value contains "Deepak Puri". But when html is displayed only "deepak" is
> displayed .
> String after the space character is not displayed.
>
> Can you please provide a solution to this ASAP.

Your HTML is to blame.
If you have a space in the value, then you should surround the value
with quotes in the HTML.

value="<TMPL_VAR NAME=cust_name>"

Carl


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.