Mailing List Archive

Embperl 1.2.1 bug? Prefilling fields w/entity-encoded values
Hi,

I find that Embperl version 1.2.1 is not properly pre-filling radio and checkbox fields when the value attribute is entity-encoded.

In the minimal example file below:

<HTML>
[- $fdat{test} = "jack & jill"; -]
<FORM>
<input type="radio" name="test" value="jack &amp; jill">jack & jill
<input type="radio" name="test" value="jack & jill" >jack & jill

<input type="checkbox" name="test" value="jack &amp; jill">jack & jill
<input type="checkbox" name="test" value="jack & jill" >jack & jill
</FORM>
</HTML>

... both of the radio buttons and both of the check boxes should be checked, but what happens is that only the ones in which the "&" is NOT entity-encoded are getting checked.

This bug occurs regardless of whether the value attribute is filled in as hardcoded HTML or whether it's inserted using Embperl's [+ +] syntax.

Maybe this has been fixed in a later Embperl, but unfortunately, I am not currently able to get the later version and try it. Would be grateful if someone with a later version can confirm whether the above bug still occurs in that version.

I believe the solution to the bug is for Embperl to run the proper entity-decoding on the value fields BEFORE it decides whether to supply the "checked" attribute.

Regards,

-chris

------------------------------------------------------------------------
Chris Thorman (413) 473-0853 e-fax
------------------------------------------------------------------------
RE: Embperl 1.2.1 bug? Prefilling fields w/entity-encoded values [ In reply to ]
Hi,
>
> I find that Embperl version 1.2.1 is not properly pre-filling
> radio and checkbox fields when the value attribute is entity-encoded.
>
>...
> Maybe this has been fixed in a later Embperl, but unfortunately,
> I am not currently able to get the later version and try it.
> Would be grateful if someone with a later version can confirm
> whether the above bug still occurs in that version.
>

A quick look thru the code shows that this bug is still there. I have
inserted the entity decoding for text input fields, but forgot it for radio
and checkbox. I put it on the TODO list

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
-------------------------------------------------------------