On Tue, Mar 29, 2011 at 8:43 PM, Victor Churchill
<[email protected]> wrote:
> Trouble is I would like to use id="q1_select.0" as a JQuery selector
> to control the show/hide of 'child' questions, and the selector does
> not like the ".0". I determined with a couple of manual tests that I
> can't select an item with a period in the ID - or so it appears
> anyway.

I had the same issue, not sure if it was for the same reasons.. but
now have this in my code.. (use '-' instead of '.' in form id's)

my forms have a base class which contains:

has '+field_traits' => ( default => sub { ['My::Form::Role'] } );

and then..

package My::Form::Role;
use Moose::Role;

around 'build_id' => sub {
  my $orig = shift;
  my $self = shift;
  my $prefix = ( $self->form && $self->form->html_prefix ) ?
$self->form->name . "-" : '';
  return $prefix . $self->full_name;
};

no Moose::Role;

1;

cheers,

J

_______________________________________________
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