PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Set qf date format of element auto-generated by DB_Table

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
stretchwickster



Joined: 06 Nov 2006
Posts: 1

PostPosted: Mon Nov 06, 2006 7:11 pm    Post subject: Set qf date format of element auto-generated by DB_Table Reply with quote

Hi,

I am using DB_Table to automatically generate an html_quickform input form based on a number of defined table columns. I have a class called SampleDetails which extends DB_Table in which I have specified my table columns in the $col property (an excerpt is shown below).

Code:

    // define table columns
    var $col = array(
   
     ...
       
      'dateCollected' => array(
        'type'    => 'date',
        'require' => true,
        'qf_label' => 'Date Collected:',
        'qf_type'  => 'date'
      ),

     ...


In particular, I have a date field called 'dateCollected' for which I need to set the following quickform options: minYear, maxYear and format.

I can't find a way to add these options when the quickform element is generated from a table column definition. I've tried the following code, but this doesn't seem to have any effect as I think the auto-generated 'dateCollected' element is taking precedence.
Code:

  $element =& $sampleDetails->getFormElement('dateCollected', 'dateCollected');
  $options = array(
    'language'  => 'en',
    'format'    => 'dMY',
    'minYear'   => 2004,
    'maxYear'   => 2029
  );
  $form->addElement($element,$options);


Can anyone assist?

Your advice would be much appreciated!
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1210

PostPosted: Sun Jan 07, 2007 6:40 pm    Post subject: Reply with quote

For the archives (and people interested in this topic): I have answered this question on the codewalkers.com forum.
Back to top
View user's profile Send private message
marksu



Joined: 21 Jul 2006
Posts: 28

PostPosted: Tue Mar 06, 2007 12:25 pm    Post subject: Reply with quote

mark wrote:
For the archives (and people interested in this topic): I have answered this question on the codewalkers.com forum.


Direct link:
http://codewalkers.com/forum/index.php?action=displaythread&forum=pear&id=240&realm=default
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software