 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
stretchwickster
Joined: 06 Nov 2006 Posts: 1
|
Posted: Mon Nov 06, 2006 7:11 pm Post subject: Set qf date format of element auto-generated by DB_Table |
|
|
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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1053
|
Posted: Sun Jan 07, 2007 6:40 pm Post subject: |
|
|
| For the archives (and people interested in this topic): I have answered this question on the codewalkers.com forum. |
|
| Back to top |
|
 |
marksu
Joined: 21 Jul 2006 Posts: 28
|
|
| Back to top |
|
 |
|
|
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
|
|