DateTime Picker - Problem with inputOutputFormat

dimna , March 05 2012
d
dimna

Hello,

i have got a problem with saving data via datepicker.
I am working with Joomal 1.6.3 and Chronoforms 4.0 RC2.0

On the Form General tab | DateTime Picker config box please I put the text :

				format: 'j. M Y', inputOutputFormat: 'Y-m-d H:i:s'
				


This is the relevant part of my form:
				<div class="ccms_form_element cfdiv_datetime" id="von_container_div"><label for="von">von</label><input id="von" maxlength="150" size="16" class=" validate['required','target:von_clone_id'] cf_datetime_picker" title="" label_over="0" hide_label="0" type="text" value="" name="von" />
<div class="clear"></div><div id="error-message-von"></div></div>


When I debug the form the field “von” looks OK
				Data Array: 
Array
(
[name] => Synfis
[kommentar] => Test
[stoerid] => 3
[von] => 2012-03-01 10:55:43
[bis] => 2012-03-07 10:57:23
[input_submit_13] => Submit
[056d0115f116b89db97144884945e1da] => 1
[option] => com_chronoforms
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[chronoform_data] => Array
(
[cf_uid] => e113d64d32e136078c07ed16e6cefe9e
[cf_created] => 2012-03-05 10:46:52
[cf_ipaddress] => 25.13.33.165
[cf_user_id] => 0
[name] => Synfis
[kommentar] => Test
[stoerid] => 3
[von] => 2012-03-01 10:55:43
[bis] => 2012-03-07 10:57:23
[input_submit_13] => Submit
[056d0115f116b89db97144884945e1da] => 1
[option] => com_chronoforms
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[id] => 2
)

[chronoform_data_id] => 2
)


But in my database, there are no new data.

But the databasepart is OK. I tried using a inputbox and in this case everything is saving OK in the database.

Can you help me please in finding my failure?

Kind regards
astrid

GreyHead

Hi astrid,

What you say there is 'no new data' in the database is there no record at all or is everything saved except the von and bis columns?

Bob

d
dimna

Thank you very much for your quick repl.
There is no new record in the database.

Kind regards
astrid

d
dimna

My idea is: When I use the input field, I write the date in this form:
'2012-03-05 11:24:58' – I mean, I use apostrophe. Is it possible, that the date picker “forget” this apostrophes?

Kind regards
Astrid

d
dimna

All data are stored OK when I use a input field. Here the relevant part of the form with a input field:

<div id="error-message-stoerid"></div></div><div class="ccms_form_element cfdiv_text" id="von_container_div"><label for="von">von</label><input id="von" maxlength="150" size="30" class="" title="" label_over="0" hide_label="0" type="text" value="" name="von" />
<div class="clear"></div><div id="error-message-von"></div></div>


The debug with the input fields looks like this:
Data Array:

Array
(
[name] => Synfis
[kommentar] =>
[stoerid] => 18188
[von] => '2012-03-01 10:55:43'
[bis] => '2012-03-01 10:55:43'
[input_submit_13] => Submit
[c6b537974e39787d512d6e19c17896a5] => 1
[option] => com_chronoforms
[id] => 18188
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[chronoform_data] => Array
(
[cf_uid] => 3c6d2b6548bda75b2b8c8765db66ec64
[cf_created] => 2012-03-05 11:18:48
[cf_ipaddress] => 25.13.33.165
[cf_user_id] => 56
[name] => Synfis
[kommentar] =>
[stoerid] => 18188
[von] => '2012-03-01 10:55:43'
[bis] => '2012-03-01 10:55:43'
[input_submit_13] => Submit
[c6b537974e39787d512d6e19c17896a5] => 1
[option] => com_chronoforms
[id] => 18188
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[id2] => 6
)

[chronoform_data_id2] => 6
)

GreyHead

Hi Astrid,

There should't be any apostrophes - they are added when the data is saved.

Pleas temporarily turn on Site Debug then Submit the form and see exactly what MySQL query is being created.

Bob

d
dimna

Hello Bob,
thank you very much for you help.


I turned on Site Debug, then I Submit the form and ..




Data Array:

Array
(
[name] => Synfis
[kommentar] => xyz
[stoerid] => 18206
[von] => 2012-03-31 13:47:41
[bis] => 2012-03-31 13:47:47
[input_submit_13] => Submit
[c6b537974e39787d512d6e19c17896a5] => 1
[option] => com_chronoforms
[id] => 18206
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[chronoform_data] => Array
(
[cf_uid] => 415d9c305aa744cf6b7ee9ed1482af72
[cf_created] => 2012-03-05 13:37:23
[cf_ipaddress] => 25.13.33.165
[cf_user_id] => 56
[name] => Synfis
[kommentar] => xyz
[stoerid] => 18206
[von] => 2012-03-31 13:47:41
[bis] => 2012-03-31 13:47:47
[input_submit_13] => Submit
[c6b537974e39787d512d6e19c17896a5] => 1
[option] => com_chronoforms
[id] => 18206
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[id2] => 3
)

[chronoform_data_id2] => 3
)




[b]This is the

				Data Array:[/b]


Array
(
[name] => Synfis
[kommentar] => xyz
[stoerid] => 18206
[von] => 2012-03-31 13:47:41
[bis] => 2012-03-31 13:47:47
[input_submit_13] => Submit
[c6b537974e39787d512d6e19c17896a5] => 1
[option] => com_chronoforms
[id] => 18206
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[chronoform_data] => Array
(
[cf_uid] => 415d9c305aa744cf6b7ee9ed1482af72
[cf_created] => 2012-03-05 13:37:23
[cf_ipaddress] => 25.13.33.165
[cf_user_id] => 56
[name] => Synfis
[kommentar] => xyz
[stoerid] => 18206
[von] => 2012-03-31 13:47:41
[bis] => 2012-03-31 13:47:47
[input_submit_13] => Submit
[c6b537974e39787d512d6e19c17896a5] => 1
[option] => com_chronoforms
[id] => 18206
[chronoform] => SB_Techniker_Anlegen
[event] => submit
[Itemid] =>
[id2] => 3
)

[chronoform_data_id2] => 3
)


The query should bee something like this (it is a costum database):

INSERT INTO `tab_techniker_zugewiesen_import` (`id2`, `name`, `begin`, `ende`, `kommentar`, `stoerid`) VALUES
(1, 'Synfis', '2012-03-04 01:00:00', '2012-03-13 00:03:00', '', 19045);



Thanks and kind regards
Astrid

GreyHead

Hi Astrid,

I think that may be the Form Debug; Site Debug is in the site Global Configuration and shows a long list of MySQL queries at the bottom of each page.

Bob

d
dimna

Sorry, here the Site Debug:

				Profile Information
Application 0.009 seconds (+0.009); 0.28 MB (+0.28) - afterLoad
Application 0.221 seconds (+0.212); 3.06 MB (+2.78) - afterInitialise
Application 0.258 seconds (+0.038); 3.54 MB (+0.48) - afterRoute
Application 0.502 seconds (+0.244); 6.34 MB (+2.80) - afterDispatch
Application 0.616 seconds (+0.114); 6.72 MB (+0.38) - afterRender
Memory Usage
6.73 MB (7,053,224 Bytes)
16 Queries Logged
SELECT `data`
FROM `jos_session`
WHERE `session_id` = '1cb225cf6154775514927394460a46ba'
DELETE
FROM `jos_session`
WHERE `time` < 1330947827
SELECT folder AS type, element AS name, params
FROM jos_extensions
WHERE enabled >= 1
AND type ='plugin'
AND state >= 0
AND access IN (1,1)
ORDER BY ordering
SELECT extension_id AS "id", element AS "option", params, enabled
FROM jos_extensions
WHERE `type` = 'component'
AND `element` = 'com_languages'
SELECT m.id, m.menutype, m.title, m.alias, m.path AS route, m.link, m.type, m.level,m.browserNav, m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id,m.language,e.element as component
FROM jos_menu AS m
LEFT JOIN jos_extensions AS e
ON m.component_id = e.extension_id
WHERE m.published = 1
AND m.parent_id > 0
AND m.client_id = 0
AND m.access IN (1,1)
ORDER BY m.lft
SELECT extension_id AS "id", element AS "option", params, enabled
FROM jos_extensions
WHERE `type` = 'component'
AND `element` = 'com_content'
SELECT *
FROM jos_languages
WHERE published=1
ORDER BY lang_id ASC
SELECT id, home, template, params
FROM jos_template_styles
WHERE client_id = 0
SELECT b.rules
FROM jos_assets AS a
LEFT JOIN jos_assets AS b
ON b.lft <= a.lft
AND b.rgt >= a.rgt
WHERE a.name = 'com_content'
ORDER BY b.lft
SELECT extension_id AS "id", element AS "option", params, enabled
FROM jos_extensions
WHERE `type` = 'component'
AND `element` = 'com_users'
SELECT a.id, a.asset_id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, CASE WHEN badcats.id is null THEN a.state ELSE 0 END AS state, a.mask, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.attribs, a.version, a.parentid, a.ordering, a.metakey, a.metadesc, a.access, a.hits, a.metadata, a.featured, a.language, a.xreference,c.title AS category_title, c.alias AS category_alias, c.access AS category_access,u.name AS author,contact.id as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count as rating_count
FROM jos_content AS a
LEFT JOIN jos_categories AS c
on c.id = a.catid
LEFT JOIN jos_users AS u
on u.id = a.created_by
LEFT JOIN jos_contact_details AS contact
on contact.user_id = a.created_by
LEFT JOIN jos_categories as parent
ON parent.id = c.parent_id
LEFT JOIN jos_content_rating AS v
ON a.id = v.content_id
LEFT
OUTER JOIN (SELECT cat.id as id
FROM jos_categories AS cat JOIN jos_categories AS parent
ON cat.lft BETWEEN parent.lft
AND parent.rgt
WHERE parent.extension = 'com_content'
AND parent.published <= 0
GROUP BY cat.id) AS badcats
ON badcats.id = c.id
WHERE a.id = 68
AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2012-03-05 14:43:48')
AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2012-03-05 14:43:48')
AND (a.state = 1 OR a.state =2)
SELECT c.*,CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug
FROM jos_categories as c
LEFT JOIN jos_categories AS s
ON (s.lft <= c.lft
AND s.rgt >= c.rgt) OR (s.lft > c.lft
AND s.rgt < c.rgt)
LEFT JOIN (SELECT cat.id as id
FROM jos_categories AS cat JOIN jos_categories AS parent
ON cat.lft BETWEEN parent.lft
AND parent.rgt
WHERE parent.extension = 'com_content'
AND parent.published != 1
GROUP BY cat.id) AS badcats
ON badcats.id = c.id
WHERE (c.extension='com_content' OR c.extension='system')
AND c.access IN (1,1)
AND c.published = 1
AND s.id=14
AND badcats.id is null
GROUP BY c.id
ORDER BY c.lft
UPDATE jos_content
SET hits = hits + 1
WHERE id = 68
SELECT id, title, module, position, content, showtitle, params, mm.menuid
FROM jos_modules AS m
LEFT JOIN jos_modules_menu AS mm
ON mm.moduleid = m.id
WHERE m.published = 1
AND (m.publish_up = '0000-00-00 00:00:00' OR m.publish_up <= '2012-03-05 14:43:48')
AND (m.publish_down = '0000-00-00 00:00:00' OR m.publish_down >= '2012-03-05 14:43:48')
AND m.access IN (1,1)
AND m.client_id = 0
AND (mm.menuid = 485 OR mm.menuid <= 0)
ORDER BY position, ordering
SELECT `link`
FROM `jos_menu`
WHERE `published`=1
AND `id`='485'
UPDATE `jos_session`
SET `data` = '__default|a:8:{s:15:\"session.counter\";i:7;s:19:\"session.timer.start\";i:1330942299;s:18:\"session.timer.last\";i:1330956728;s:17:\"session.timer.now\";i:1330958627;s:22:\"session.client.browser\";s:125:\"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)\";s:8:\"registry\";O:9:\"JRegistry\":1:{s:7:\"\0*\0data\";O:8:\"stdClass\":0:{}}s:4:\"user\";O:5:\"JUser\":23:{s:9:\"\0*\0isRoot\";b:0;s:2:\"id\";i:0;s:4:\"name\";N;s:8:\"username\";N;s:5:\"email\";N;s:8:\"password\";N;s:14:\"password_clear\";s:0:\"\";s:8:\"usertype\";N;s:5:\"block\";N;s:9:\"sendEmail\";i:0;s:12:\"registerDate\";N;s:13:\"lastvisitDate\";N;s:10:\"activation\";N;s:6:\"params\";N;s:6:\"groups\";a:0:{}s:5:\"guest\";i:1;s:10:\"\0*\0_params\";O:9:\"JRegistry\":1:{s:7:\"\0*\0data\";O:8:\"stdClass\":0:{}}s:14:\"\0*\0_authGroups\";a:1:{i:0;s:1:\"1\";}s:14:\"\0*\0_authLevels\";a:2:{i:0;i:1;i:1;i:1;}s:15:\"\0*\0_authActions\";N;s:12:\"\0*\0_errorMsg\";N;s:10:\"\0*\0_errors\";a:0:{}s:3:\"aid\";i:0;}s:13:\"session.token\";s:32:\"865c4ac6023a0b88d892b58b9491fcf5\";}', `time` = 1330958628
WHERE `session_id` = '1cb225cf6154775514927394460a46ba'
14 Query Types Logged, Sorted by Occurrences.
SELECT Tables:
3 × SELECT extension_id AS "id", element AS "option", params, enabled FROM jos_extensions
1 × SELECT a.id, a.asset_id, a.title, a.alias, a.title_alias, a.introtext, a.fulltext, CASE WHEN badcats.id is null THEN a.state ELSE 0 END AS state, a.mask, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by, a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.attribs, a.version, a.parentid, a.ordering, a.metakey, a.metadesc, a.access, a.hits, a.metadata, a.featured, a.language, a.xreference,c.title AS category_title, c.alias AS category_alias, c.access AS category_access,u.name AS author,contact.id as contactid,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count as rating_count FROM jos_content AS a LEFT JOIN jos_categories AS c on c.id = a.catid LEFT JOIN jos_users AS u on u.id = a.created_by LEFT JOIN jos_contact_details AS contact on contact.user_id = a.created_by LEFT JOIN jos_categories as parent ON parent.id = c.parent_id LEFT JOIN jos_content_rating AS v ON a.id = v.content_id LEFT OUTER JOIN (SELECT cat.id as id FROM jos_categories AS cat JOIN jos_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt
1 × SELECT c.*,CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as slug FROM jos_categories as c LEFT JOIN jos_categories AS s ON (s.lft <= c.lft AND s.rgt >= c.rgt) OR (s.lft > c.lft AND s.rgt < c.rgt) LEFT JOIN (SELECT cat.id as id FROM jos_categories AS cat JOIN jos_categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt
1 × SELECT id, title, module, position, content, showtitle, params, mm.menuid FROM jos_modules AS m LEFT JOIN jos_modules_menu AS mm ON mm.moduleid = m.id
1 × SELECT b.rules FROM jos_assets AS a LEFT JOIN jos_assets AS b ON b.lft <= a.lft AND b.rgt >= a.rgt
1 × SELECT `link` FROM `jos_menu`
1 × SELECT id, home, template, params FROM jos_template_styles
1 × SELECT folder AS type, element AS name, params FROM jos_extensions
1 × SELECT m.id, m.menutype, m.title, m.alias, m.path AS route, m.link, m.type, m.level,m.browserNav, m.access, m.params, m.home, m.img, m.template_style_id, m.component_id, m.parent_id,m.language,e.element as component FROM jos_menu AS m LEFT JOIN jos_extensions AS e ON m.component_id = e.extension_id
1 × SELECT * FROM jos_languages
1 × SELECT `data` FROM `jos_session`
OTHER Tables:
1 × UPDATE `jos_session` SET `data` = '__default|a:8:{s:15:\"session.counter\";i:7;s:19:\"session.timer.start\";i:1330942299;s:18:\"session.timer.last\";i:1330956728;s:17:\"session.timer.now\";i:1330958627;s:22:\"session.client.browser\";s:125:\"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)\";s:8:\"registry\";O:9:\"JRegistry\":1:{s:7:\"\0*\0data\";O:8:\"stdClass\":0:{}}s:4:\"user\";O:5:\"JUser\":23:{s:9:\"\0*\0isRoot\";b:0;s:2:\"id\";i:0;s:4:\"name\";N;s:8:\"username\";N;s:5:\"email\";N;s:8:\"password\";N;s:14:\"password_clear\";s:0:\"\";s:8:\"usertype\";N;s:5:\"block\";N;s:9:\"sendEmail\";i:0;s:12:\"registerDate\";N;s:13:\"lastvisitDate\";N;s:10:\"activation\";N;s:6:\"params\";N;s:6:\"groups\";a:0:{}s:5:\"guest\";i:1;s:10:\"\0*\0_params\";O:9:\"JRegistry\":1:{s:7:\"\0*\0data\";O:8:\"stdClass\":0:{}}s:14:\"\0*\0_authGroups\";a:1:{i:0;s:1:\"1\";}s:14:\"\0*\0_authLevels\";a:2:{i:0;i:1;i:1;i:1;}s:15:\"\0*\0_authActions\";N;s:12:\"\0*\0_errorMsg\";N;s:10:\"\0*\0_errors\";a:0:{}s:3:\"aid\";i:0;}s:13:\"session.token\";s:32:\"865c4ac6023a0b88d892b58b9491fcf5\";}', `time` = 1330958628
1 × UPDATE jos_content SET hits = hits + 1
1 × DELETE FROM `jos_session`

GreyHead

Hi Astrid,

Thank you that's it. But there's nothing in there from ChronoForms which is a bit surprising. Is this what you see when you submit the form?

Bob

d
dimna

Hello,
Yes, that’s it . I was confused, too.
Do you have an idea?
Kind regards
Astrid

GreyHead

Hi Astrid,

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob

Powered by ChronoForums - ChronoEngine.com

ChronoForms Book

The ChronoForms Book, written for ChronoForms v3 contains 350 pages of invaluable ChronoForms How-tos hints and tips.

Note: many of the ideas can be used in ChronoForms v4 but the admin interface is very different and code examples may need to be modified.

SSL

Members Login

 

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for
goods and services provided by ChronoEngine.com