Mailing List Archive

Bug with CHECKED in <input></input> and SELECTED in <option></option> tags
I wonder if anyone has noticed this error in embperl. Embperl will refuse
to print out CHECKED or SELECTED with in <input> or <select> tags if they
are stored within a variable. I think the following code example will best
explain the situation.

[.-
#store values
$value1 = "";
$value2 = "";

#do whatever processing then based on a response, now select which
#input tag to mark as checked
$value1 = "CHECKED";
-]

<input [+$value1+] type="radio" name="cc" value="0">

The only result I have gotten is that nothing will ever be printed out. Now
of course I've used work arounds like doing an if-then block, but I wonder
if this is a bug? The same occurs in <select> blocks when trying to place
SELECTED in an <option> tag by using a variable.

Joe


______________________________________________________
Joe Lauer
work/home (202)238-1349
cell (202)345-2335

Send me a page through SimpleWire.com. Just hit this url:
http://www.simplewire.com/sendpage.epl?alias=joelauer@rootlevel.com&submit=G
o%20To%20Step%202
Re: Bug with CHECKED in <input></input> and SELECTED in <option></option> tags [ In reply to ]
Hi.

It's very strange. I found no error with your code and result.
I have copied your code and $value1 and $value2 work properly.
result comes
<input CHECKED type="radio" name="cc" value="0">

I guess, it may be another problem.....

bye.

On Tue, 18 Apr 2000, Joe Lauer wrote:

> I wonder if anyone has noticed this error in embperl. Embperl will refuse
> to print out CHECKED or SELECTED with in <input> or <select> tags if they
> are stored within a variable. I think the following code example will best
> explain the situation.
>
> [.-
> #store values
> $value1 = "";
> $value2 = "";
>
> #do whatever processing then based on a response, now select which
> #input tag to mark as checked
> $value1 = "CHECKED";
> -]
>
> <input [+$value1+] type="radio" name="cc" value="0">
>
> The only result I have gotten is that nothing will ever be printed out. Now
> of course I've used work arounds like doing an if-then block, but I wonder
> if this is a bug? The same occurs in <select> blocks when trying to place
> SELECTED in an <option> tag by using a variable.
>
> Joe
>
>
> ______________________________________________________
> Joe Lauer
> work/home (202)238-1349
> cell (202)345-2335
>
> Send me a page through SimpleWire.com. Just hit this url:
> http://www.simplewire.com/sendpage.epl?alias=joelauer@rootlevel.com&submit=G
> o%20To%20Step%202
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>
RE: Bug with CHECKED in <input></input> and SELECTED in <option></option> tags [ In reply to ]
Hi,

> I wonder if anyone has noticed this error in embperl.

Not everything that people think is an error of Embperl... :-)

> Embperl will refuse
> to print out CHECKED or SELECTED with in <input> or <select> tags if they
> are stored within a variable. I think the following code example
> will best
> explain the situation.
>
> [.-
> #store values
> $value1 = "";
> $value2 = "";
>
> #do whatever processing then based on a response, now select which
> #input tag to mark as checked
> $value1 = "CHECKED";
> -]
>
> <input [+$value1+] type="radio" name="cc" value="0">
>
> The only result I have gotten is that nothing will ever be
> printed out. Now
> of course I've used work arounds like doing an if-then block, but I wonder
> if this is a bug? The same occurs in <select> blocks when trying to place
> SELECTED in an <option> tag by using a variable.
>

I guess your %fdat contains a value for the key 'cc' which is not equal 0.
In this case Embperl will remove the CHECKED form the input tag, if the
value of $fdat{'cc'} eq '0' then Embperl will add the CHECKED to your INPUT
tag. If $fdat{'cc'} doesn't exists, then Embperl will leave your INPUT tag
untouched. So either do a

[- delete $fdat{'cc'} -]

before your INPUT tag, or, better, a

[- $fdat{'cc'} = 0 -]
<input type="radio" name="cc" value="0">


Gerald



-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------