Re: Re: <LIST> TAG default value in ver 3.2.2
Joel Palmius <[email protected]> Wed, 26 Jan 2005 11:07:49 +0100 (CET)
| Newsgroups | gmane.comp.apache.mod-survey.general |
|---|---|
| Message-ID | <[email protected]> |
My guess is that the fault is with "$chkpersist == $doc->..."
When $chkpersist is undef, empty or null, the comparison will be true if
VALUE is undef, empty or null. This is probably a bit too wide. The first
check should probably be if persistance is used at all,
And possibly the "eq" operator should be used rather than "==" to narrow
it down a bit.
Bugant? What do you think?
// Joel
On Wed, 26 Jan 2005, Gabriele Morelli wrote:
> HI,
> I opened the file List.pm and I have seen this snippet of code that bugant
> developed:
>
> #bugant persist ;)
> if ($chkpersist == $doc->GetListElementParam($tagno,$i,"VALUE"))
> {
> $outr .= " selected=\"selected\"";
> }
> else
> {
> if($doc->GetListElementParam($tagno,$i,"SELECTED") eq "yes")
> {
> $outr .= " selected=\"selected\"";
> }
> }
>
> I've checked the HTML output on the page when the my mod_survey is running and
> it seems to write "selected" to every LISTELEMENT on the LIST tag:
>
> <select class="LISTsel" name="provdf" size="1">
> <option selected="selected" value=" "> </option>
> <option selected="selected" value="AG">AGRIGENTO</option>
>
> <option selected="selected" value="AL">ALESSANDRIA</option>
> <option selected="selected" value="AN">ANCONA</option>
> <option selected="selected" value="AO">AOSTA</option>
>
> It seems that the if statement I copied above always put "selected" to every
> item.I am not really keen on PERL but I think this is where the bug is.
>
> Gabriele
>
>>
>> // Joel
>>
>>> Gabriele
>>>
>>>
>>>
>>> Skickat av Gabriele Morelli <morelli <at> istitutodeglinnocenti.it>
>>> till survey-discussion
>>>
>> Skickat av Joel Palmius <joel.palmius <at> miun.se>
>> till survey-discussion
>>
>>
>
>
>
>
> Skickat av Gabriele Morelli <[email protected]>
> till survey-discussion
>
Skickat av Joel Palmius <[email protected]>
till survey-discussion