Catalyst (and Chaining in particular) is really, really sweet! Enjoying the
exploration immensely. So here's our next puzzle:

Objective: to DISABLE some of the <OPTION>s in a <SELECT> field.

        $teams = [
            map { [ $_->id, $_->name ] } @teams
        ];
        $form->field(
            name    => "user.$id.team",
            options => $teams,
            value   => $user->team->id,
            selectname => 'Select Team:',
            required   => 1,
        );

This gives us something like the following:

<select id="my_team" name="my_team">
  <option value="">Select Team</option>
  <option value="1">Alpha</option>
  <option value="9">Bravo</option>
  <option value="2">Delta (inactive)</option>
  <option value="7">Echo</option>
  <option value="6">Foxtrot</option>
</select>

We'd like to disable the SELECTNAME option and any INACTIVE options:

<select id="my_team" name="my_team">
  <option value="" DISABLED>Select Team</option>
  <option value="1">Alpha</option>
  <option value="9">Bravo</option>
  <option value="2" DISABLED>Delta (inactive)</option>
  <option value="7">Echo</option>
  <option value="6">Foxtrot</option>
</select>

We've tried using UNDEF in place of the team->id:

        $teams->[2][0] = undef; # where $teams->[2][1] eq 'Delta (inactive)'

But that just gives

  <option>Delta (inactive)</option>

Is there a way to include DISABLED options without s/// after
$form->prepare?

-- 
will trillich
"I think it would be worse to expect nothing than to be disappointed." --
Anne (with an 'e') Shirley
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to