Try this....
$m = 1;
foreach ($this->getOption('param') as $i)
{
$temp = 'test'.$m;
$temp1 = 'temp'.$m;
$m = $m + 1;
$this->widgetSchema['comment'.$i['id']] = new
sfWidgetFormInputCheckbox(array(), array('name' => $temp, 'id' =>
$temp1));
}
On Wed, Dec 30, 2009 at 7:09 PM, dziobacz <[email protected]> wrote:
> Now they have different names but they should have the same names and
> different ID:
>
> <input id="test1" type="checkbox" name="test1"/>
> <input id="test2" type="checkbox" name="test2"/>
> <input id="test2" type="checkbox" name="test3"/>
>
> On 30 Gru, 14:34, DEEPAK BHATIA <[email protected]> wrote:
> > Try this....
> > $m = 1;
> > foreach ($this->getOption('param') as $i)
> > {
> > $temp = 'test'.$m;
> > $m = $m + 1;
> > $this->widgetSchema['comment'.$i['id']] = new
> > sfWidgetFormInputCheckbox(array(), array('name' => $temp));
> >
> > }
> >
> > On Wed, Dec 30, 2009 at 6:43 PM, dziobacz <[email protected]>
> wrote:
> > > I still have:
> >
> > > <input id="test" type="checkbox" name="test"/>
> > > <input id="test" type="checkbox" name="test"/>
> > > <input id="test" type="checkbox" name="test"/>
> >
> > > So I can't do that what I want in Symfony forms and I must use normal
> > > forms ? :O
> >
> > > On 30 Gru, 08:59, DEEPAK BHATIA <[email protected]> wrote:
> > > > Try this....
> >
> > > > foreach ($this->getOption('param') as $i)
> > > > {
> > > > $temp = 'test'.$i;
> > > > $this->widgetSchema['comment'.$i['id']] = new
> > > > sfWidgetFormInputCheckbox(array(), array('name' => $temp));
> >
> > > > }
> > > > On Wed, Dec 30, 2009 at 12:31 PM, dziobacz <[email protected]
> >
> > > wrote:
> > > > > Is it possible to change name widget ? I am doing that:
> >
> > > > > foreach ($this->getOption('param') as $i)
> > > > > {
> > > > > $this->widgetSchema['comment'.$i['id']] = new
> > > > > sfWidgetFormInputCheckbox(array(), array('name' => 'test'));
> > > > > }
> >
> > > > > but I get:
> > > > > <input id="test" type="checkbox" name="test"/>
> > > > > <input id="test" type="checkbox" name="test"/>
> > > > > <input id="test" type="checkbox" name="test"/>
> > > > > ........
> >
> > > > > ID is the same as name !!
> >
> > > > > --
> >
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "symfony users" group.
> > > > > To post to this group, send email to
> [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected]<symfony-users%[email protected]>
> <symfony-users%[email protected]<symfony-users%[email protected]>
> >
> > > <symfony-users%[email protected]<symfony-users%[email protected]>
> <symfony-users%[email protected]<symfony-users%[email protected]>
> >
> >
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/symfony-users?hl=en.
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups
> > > "symfony users" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<symfony-users%[email protected]>
> <symfony-users%[email protected]<symfony-users%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/symfony-users?hl=en.
> >
> >
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<symfony-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.