The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Extended Client Fields - Datepicker - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Extended Client Fields - Datepicker (/showthread.php?tid=3023) |
Extended Client Fields - Datepicker - grahame - May 2nd, 2014 Hi I want to add a date field into Extended Client Fields (ecf) and for the template to offer the date picker script accordingly. I have tracked down where to amend the presentation of the ecfs i.e. section_html.tpl and have experimentally added some code which I cobbled together from a submission date-type field :- Code: {elseif $extended_field.field_type == "textbox"} My guess is I need some includes in the .tpl but which do i need please? I see various references to date picker js and css files but not those that I read I needed on a date picker tutorial? Thanks in advance for some guidance.... RE: Extended Client Fields - Datepicker - grahame - May 19th, 2014 Despite a couple of days work I could not correct this so I have instead used a Smarty special field in section_html.tpl thus {elseif $extended_field.field_type == "date"} {html_select_date field_array=ecf_$client_field_id field_order=YMD time=$extended_field.content start_year= -100 end_year= +10 year_empty="Year" month_empty="Month" day_empty="Day"} I spent a little time adding a new ECF field type of Date but I guess you could just test on field names if you wanted to keep it simpler? Unfortunately, Smarty insists on returning the date as an array of Year Month and Date so, for example, you would see 2014|05|22 written to your table. I did a quick SQL update in a hook at the end of the client update to re-format this to 2014-05-22. |