Automagic date field without the day

2009-03-11 Thread FranktheTank

I'm looking to create an automagic date field, but I only want to show
the month and year selects.  The user doesn't need to see or pick a
day.  I have used the date and year type inputs for other things, but
they are kind of inconvenient and it would be nice to treat the date
info like all the rest of the form's data. Any thoughts?

Thanks,
Frank
--~--~-~--~~~---~--~~
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: create an input with $form-input() and disable it?

2009-03-02 Thread FranktheTank

@CraigFisher: I ended up going readonly too - using the field as
disabled was not quite as intuitive as I was hoping.  It wasn't any
harder and selecting it for styling it was easy.

@mscdex: I was looking for a generic form related attribute.  id would
be a better example than width, but there's probably an option in the
options array for setting the id.  Perhaps a rel attribute or
something like that - I can't think if rel is allowed in an input tag,
but I think you get the idea.

Thanks all!
Frank


On Feb 18, 4:05 am, CraigFisher crayfis...@gmail.com wrote:
 I got caught by the phantom data loss:  the $data array after POSTing
 doesn't contain the all the fields from the Model-read; only those
 that aren't disabled - so if you fail validation, and theformis
 redisplayed, the data which was originally populated via the Model-

 read will have lost the fields which were disabled.

 Readonly and css was the way that I used... otherwise you can't use
 the 'Input' styling for consistent looks  view code.

 -C
--~--~-~--~~~---~--~~
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: create an input with $form-input() and disable it?

2009-03-02 Thread FranktheTank

Because I want to show the data as part of the form, for reference.  I
don't want it modified.

In this case, it's an id number and a created date.  Neither should be
changed, but I want both incorporated into the form.

Frank


On Mar 2, 12:52 pm, brian bally.z...@gmail.com wrote:
 Why not just make it hidden?

 On Mon, Mar 2, 2009 at 11:01 AM, FranktheTank

 frankbirchstu...@gmail.com wrote:

  @CraigFisher: I ended up going readonly too - using the field as
  disabled was not quite as intuitive as I was hoping.  It wasn't any
  harder and selecting it for styling it was easy.

  @mscdex: I was looking for a generic form related attribute.  id would
  be a better example than width, but there's probably an option in the
  options array for setting the id.  Perhaps a rel attribute or
  something like that - I can't think if rel is allowed in an input tag,
  but I think you get the idea.

  Thanks all!
  Frank

  On Feb 18, 4:05 am, CraigFisher crayfis...@gmail.com wrote:
  I got caught by the phantom data loss:  the $data array after POSTing
  doesn't contain the all the fields from the Model-read; only those
  that aren't disabled - so if you fail validation, and theformis
  redisplayed, the data which was originally populated via the Model-

  read will have lost the fields which were disabled.

  Readonly and css was the way that I used... otherwise you can't use
  the 'Input' styling for consistent looks  view code.

  -C
--~--~-~--~~~---~--~~
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: create an input with $form-input() and disable it?

2009-03-02 Thread FranktheTank

Because my client wanted a consistent interface.  I realize I could
have hard-coded the input in HTML and inserted the value, but I wanted
the advantage of the HTML helper.  It's also nice to know that if I
modify the helper, these fields will remain consistent with the rest
of the inputs.

Frank


On Mar 2, 1:54 pm, brian bally.z...@gmail.com wrote:
 On Mon, Mar 2, 2009 at 1:39 PM, FranktheTank frankbirchstu...@gmail.com 
 wrote:

  Because I want to show the data as part of the form, for reference.  I
  don't want it modified.

  In this case, it's an id number and a created date.  Neither should be
  changed, but I want both incorporated into the form.

 So just print the ID and date. Why create an input at all?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



create an input with $form-input() and disable it?

2009-02-16 Thread FranktheTank

I am looking to display some data in a form and I'd like to include
some non editable data in a disabled input box.  My client likes the
consistent look of the page and I'd like to output this data, along
with the rest of the editable data, for reference.  Is there a simple
way to use $form-input() to display a disable input box?  Or is there
a common method used as an alternative?

Thanks,
Frank
--~--~-~--~~~---~--~~
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: create an input with $form-input() and disable it?

2009-02-16 Thread FranktheTank

Thank you - this is exactly what I needed.  I love the way cake works,
though sometimes it can be so easy that it's frustrating - I end up
over-thinking and find out later that the thing I want do is a
standard, simple option or feature.

Thanks again, this worked perfectly.

On Feb 16, 3:14 pm, Marcelo Andrade mfandr...@gmail.com wrote:
 On Mon, Feb 16, 2009 at 5:01 PM, FranktheTank

 frankbirchstu...@gmail.com wrote:

  (..)  Is there a simple
  way to use $form-input() to display adisableinputbox?

 Something like that in your view must work:

 echo $form-input( 'Model.fieldname', array('disabled'= 'disabled') );

 Best regards.

 --
 MARCELO DE F. ANDRADE (aka eleKtron)
 Belem, PA, Amazonia, Brazil
 Linux User #221105

 [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
--~--~-~--~~~---~--~~
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: create an input with $form-input() and disable it?

2009-02-16 Thread FranktheTank

I do realize that the disabled field won't get posted, and I don't
want it to - it's the automatically generated Created date, and I
just wanted to show what that date is, and it's convenient to do so
right on the form.

So if I were to use the 'readonly' option, the data appears on the
form and posts with the form, but it's not editable in the form?
That's an interesting option to have.

Thanks for the info - very helpful.

Frank


On Feb 16, 4:04 pm, Me keithnorris.spect...@gmail.com wrote:
 Note that using disabled has the additional consequence that the
 disabled data you show won't POST through on the form, which may be
 OK depending on your situation. If you don't expect it, you can have
 phantom data loss

 If you want non-editable data but need it to POST, use array
 ( 'readonly' = 'readonly'). You can use css to gray it out if you
 want a disabled appearance.
--~--~-~--~~~---~--~~
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: create an input with $form-input() and disable it?

2009-02-16 Thread FranktheTank

OK, I'll admit my noobishness - can you add any HTML attribute to the
options array, and cake just adds it to the tag?  For instance, if you
add 'width' = '50' it will set width=50 in the input tag?  If so,
that rocks, and will keep me from asking questions like this one
again.

Thanks!
Frank


On Feb 16, 5:31 pm, FranktheTank frankbirchstu...@gmail.com wrote:
 I do realize that the disabled field won't get posted, and I don't
 want it to - it's the automatically generated Created date, and I
 just wanted to show what that date is, and it's convenient to do so
 right on the form.

 So if I were to use the 'readonly' option, the data appears on the
 form and posts with the form, but it's not editable in the form?
 That's an interesting option to have.

 Thanks for the info - very helpful.

 Frank

 On Feb 16, 4:04 pm, Me keithnorris.spect...@gmail.com wrote:

  Note that using disabled has the additional consequence that the
  disabled data you show won't POST through on the form, which may be
  OK depending on your situation. If you don't expect it, you can have
  phantom data loss

  If you want non-editable data but need it to POST, use array
  ( 'readonly' = 'readonly'). You can use css to gray it out if you
  want a disabled appearance.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



access the name of the active model in the view

2009-01-19 Thread FranktheTank

Short of performing surgery on the URI, how can I determine the model
which has called the current view?  I'd like to add it to my default
layout so I can automate some tabs.

Thanks.
Frank

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---