Re: Question on the method input of Form helper relative to type 'date'

2009-09-29 Thread byqsri

Sorry I have mistaked :-)

I would get:

select id=starDateDay name=data[starDate][day] .
select id=starDateMonth name=data[starDate][month] .
select id=starDateYear name=data[starDate][year]


On 18 Set, 12:05, WebbedIT p...@webbedit.co.uk wrote:
 now I've stared at them for 5 mins and I am certain they are
 identical :P

 On Sep 17, 8:17 am, byqsri marco.rizze...@gmail.com wrote:

  I get

  select id=ModelNameStartDate name=data[ModelName][StartDate]
  [day] .
  select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
  [month] .
  select id=ModelNameStartDateYear name=data[ModelName][StartDate]
  [year]
  Instead of:

  select id=ModelNameStartDate name=data[ModelName][StartDate]
  [day] .
  select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
  [month] .
  select id=ModelNameStartDateYear name=data[ModelName][StartDate]
  [year]

   You should get:

   select id=StartDate name=data[StartDate][day] .
   select id=StartDateMonth name=data[StartDate][month] .
   select id=StartDateYear name=data[StartDate][year]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-18 Thread WebbedIT

now I've stared at them for 5 mins and I am certain they are
identical :P

On Sep 17, 8:17 am, byqsri marco.rizze...@gmail.com wrote:
 I get

 select id=ModelNameStartDate name=data[ModelName][StartDate]
 [day] .
 select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
 [month] .
 select id=ModelNameStartDateYear name=data[ModelName][StartDate]
 [year]
 Instead of:

 select id=ModelNameStartDate name=data[ModelName][StartDate]
 [day] .
 select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
 [month] .
 select id=ModelNameStartDateYear name=data[ModelName][StartDate]
 [year]

  You should get:

  select id=StartDate name=data[StartDate][day] .
  select id=StartDateMonth name=data[StartDate][month] .
  select id=StartDateYear name=data[StartDate][year]


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-17 Thread byqsri

I get

select id=ModelNameStartDate name=data[ModelName][StartDate]
[day] .
select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
[month] .
select id=ModelNameStartDateYear name=data[ModelName][StartDate]
[year]
Instead of:

select id=ModelNameStartDate name=data[ModelName][StartDate]
[day] .
select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
[month] .
select id=ModelNameStartDateYear name=data[ModelName][StartDate]
[year]

 You should get:

 select id=StartDate name=data[StartDate][day] .
 select id=StartDateMonth name=data[StartDate][month] .
 select id=StartDateYear name=data[StartDate][year]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-16 Thread WebbedIT

New one on me ... guess that's egg on my face for presuming cake would
not change things dependant on POST or GET being used.  I personally
don't use GET so should have kept my mouth shut :)

Thanks for the detailed explanation.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-15 Thread WebbedIT

@Kevin: Where were you entering 'type'='get'?  It should go into the
$form-create() call and will not cause the form helper to alter the
way in which it automagically names fields.

Paste your view and resulting HTML output and I will explain what's
happening.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-15 Thread Kevin Wentworth

@WebbedIT: Thanks for the response.  I do have it in the $form-create
(). I believe this is a bug.

Cakephp will only use the field name in a form where type=get.  The
code in the form helper __name() function has special logic for
method=get forms.  This logic severely limits the complexity of get
forms.  It basically removes the ability to have arrays of data.  That
is the issue with the date input- all 3 fields (the selects for month,
day, and year) are named the same thing, so all you get is the last
value (i.e. year).

I did find this ticket-  https://trac.cakephp.org/ticket/6283.
Although I agree with the response to the ticket (about $this-data
being reserved for post) I think the special logic for get forms
should be removed.  If you use the same __name() function (in
app_helper.php) for get forms, the data doesn't show up in $this-
data, rather it shows up in $this-params['url']['data'].  Isn't this
enough of a distinction?

For reference, here is my view code and rendered HTML:

In view:

echo $form-create('Avevent', array('url'=array('action'='index'),
'id'='calForm', 'type'='get'));
echo $form-input('pager', array('type'='date', 'selected'=
$pager_current_date));

HTML rendered (notice same name for all 3 select fields):

div class=input datelabel for=AveventPagerMonthPager/label
select name=pager id=AveventPagerMonth
option value=01January/option
.
option value=12December/option
/select-select name=pager id=AveventPagerDay
option value=011/option
.
option value=3131/option
/select-select name=pager id=AveventPagerYear
option value=20292029/option
.
option value=19891989/option
/select/div

Thanks,
-Kevin

On Sep 15, 4:32 am, WebbedIT p...@webbedit.co.uk wrote:
 @Kevin: Where were you entering 'type'='get'?  It should go into the
 $form-create() call and will not cause the form helper to alter the
 way in which it automagically names fields.

 Paste your view and resulting HTML output and I will explain what's
 happening.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-14 Thread WebbedIT

Sure:

$form-input(StartDate, array('type'='date'));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-14 Thread byqsri

I get also the model name .
Is it possible to obtain:

select id=starDateDay name=data[starDate][day] .
select id=starDateDay name=data[starDate][month] .
select id=starDateDay name=data[starDate][year]

Instead of:

select id=ModelNameStartDate name=data[ModelName][StartDate]
[day] .
select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
[month] .
select id=ModelNameStartDateYear name=data[ModelName][StartDate]
[year]


On 14 Set, 09:38, WebbedIT p...@webbedit.co.uk wrote:
 Sure:

 $form-input(StartDate, array('type'='date'));
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-14 Thread WebbedIT

Try: $form-input(StartDate, array('type'='date',
'id'='StartDate'));

You should get:

select id=StartDate name=data[StartDate][day] .
select id=StartDateMonth name=data[StartDate][month] .
select id=StartDateYear name=data[StartDate][year]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-14 Thread Kevin Wentworth

I just ran into the same issue.  In my case, I wanted the form to use
method=get (or type=get).  This causes cakephp (1.2.5) to use the
wrong string for the name.  The id attribute is correctly named, but
not the name attribute. Is this a bug?

Not sure if this is your issue or not, but I did a lot of testing and
they type=get is the problem for me.



On Sep 14, 12:07 pm, WebbedIT p...@webbedit.co.uk wrote:
 Try: $form-input(StartDate, array('type'='date',
 'id'='StartDate'));

 You should get:

 select id=StartDatename=data[StartDate][day] .
 select id=StartDateMonthname=data[StartDate][month] .
 select id=StartDateYearname=data[StartDate][year]

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-13 Thread byqsri

Please Can you me make an example ?

On 12 Set, 09:52, WebbedIT p...@webbedit.co.uk wrote:
 Should work without the ModelName if you supply 'type'='date'
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-12 Thread WebbedIT

Should work without the ModelName if you supply 'type'='date'
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-11 Thread WebbedIT

When you move away from the conventions and things go wrong, it's so
much harder to debug.  What does e($form-input
('ModelName.start_date'); produce?

It should produce

select id=ModelNameStartDate name=data[ModelName][StartDate]
[day] .
select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
[month] .
select id=ModelNameStartDateYear name=data[ModelName][StartDate]
[year]

I reckon the problem lies somewhere in the fact your resultant code
does not have a ModelName and your field is startDate (which should be
start_date using convention) yet your telling $form-input to use
starDate (missing 't').
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Question on the method input of Form helper relative to type 'date'

2009-09-11 Thread byqsri

Ok ... all is right ... But this 'start_date' field isn't a model's
field but a date to do a search.
I can use it like a Model.start_date but conceptually this is wrong.

On 11 Set, 11:04, WebbedIT p...@webbedit.co.uk wrote:
 When you move away from the conventions and things go wrong, it's so
 much harder to debug.  What does e($form-input
 ('ModelName.start_date'); produce?

 It should produce

 select id=ModelNameStartDate name=data[ModelName][StartDate]
 [day] .
 select id=ModelNameStartDateMonth name=data[ModelName][StartDate]
 [month] .
 select id=ModelNameStartDateYear name=data[ModelName][StartDate]
 [year]

 I reckon the problem lies somewhere in the fact your resultant code
 does not have a ModelName and your field is startDate (which should be
 start_date using convention) yet your telling $form-input to use
 starDate (missing 't').
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Question on the method input of Form helper relative to type 'date'

2009-09-10 Thread marco.rizze...@gmail.com

Hi
I use Form helper like this:
e($form-input(
'startDate' ,
array(
'id' = 'starDate',
'name' = 'data[starDate]',
'label' = 'strongStart date/strong:' ,
'type' = 'date',
'dateFormat' = 'DMY',
'empty' = false,
'monthNames' = false,
'minYear' = date('Y')-1,
'maxYear' = date('Y')+1
)
));
The HTML result is:

select id=starDateDay name=data[starDate]..
select id=starDateDay name=data[starDate]..
select id=starDateDay name=data[starDate]..

Instead how can I have :
select id=starDateDay name=data[starDate][day] .
select id=starDateDay name=data[starDate][month] .
select id=starDateDay name=data[starDate][year]

Marco
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---