Buy Now
Sign in

SOLVED: Date problem ("datetimepicker" format)

lemur , April 17 2009, 15:17
lemur 43
April 17 2009, 15:17 #30115

I can write data in the table jos_comprogiler now (i am using 3.1 RC4.11).

But I have yet problems with the date field, that i have made: cb_geburtstag (DE: cb_birthday :-)).

1. Form HTML:

<div class="form_item">
<div class="form_element cf_datetimepicker">
<label class="cf_label">Geburtstag:</label>
<input class="cf_datetime required" maxlength="-1" title="" size="20" id="cb_geburtstag"
name="cb_geburtstag" type="text" />

2. In E-Mail I get all OK! :

Geburtstag: 02/04/2009

3. This is Debug:

 1. Form passed first SPAM check OK
2. Form passed the submissions limit (if enabled) OK
3. Form passed the Image verification (if enabled) OK
4. Form passed the server side validation (if enabled) OK
5. $_POST Array: Array ( [cb_geschlecht] => Herr [cb_vorname2] => g [cb_name2] => g [address]
=> g [cb_hausnummer] => g [zipcode] => 6 [location] => g [cb_geburtstag] => 02/04/2009 [text_10]
=> [id] => 67 [cb_gltcode] => M67bSoB8-11-05co [095314e71cd80313d4c76d661785f5fa] => 1 )
6. $_FILES Array: Array ( )
7. Form passed the plugins step (if enabled) OK
8. An email has been SENT successfully from ( Team) to
9. Debug End
10. Redirect link set, click to test: index.php

So, [cb_geburtstag] => 02/04/2009 - OK!

4. In AutoGenerated Code:

Form Fields names:

Form Fields types:

Date Fields names: cb_geburtstag

5. Type of field in Community Builder:
cb_geburtstag   Geburtstag   date

6. but in the table jos_comprogiler I get:

#      Record #n   user_id   cb_gltcode   cb_geschlecht   cb_vorname2   cb_name2   address   cb_hausnummer   zipcode   location   cb_geburtstag
7       Record 7   67    (EMPTY)   Herr   g   g   g   g   6   g   0000-00-00
That is,

cb_geburtstag is 0000-00-00


What is wrong, please?
GreyHead 65
April 17 2009, 18:04 #30129
Hi lemur,

You need to transform the date field back into YYYY-MM-DD format before it will save as a MySQL date. Not sure about the code - it may just be that the date throws an error and the code field is never saved. I'm not conviced but don't have a better suggestion.

If you'd like to buy me a coffee or two, thank you very much
lemur 43
April 20 2009, 08:42 #30297
Hi, Bob.

Thank you!

I have transformed "Date Format" to "Y-m-d" (from d/m/Y) in "general"
and it works (for "datetimepicker" format)!.

GreyHead 65
April 20 2009, 08:58 #30300
Hi lemur,

The format for the datepicker is set on the form general tab - default is 'd/m/y' I think. You can save this into the database as a text string but if you want to use a DATE field then it will need to be changed into the appropriate format and I don' think that ChronoForms automatically does that.

You'll need a little PHP in the onSubmit box to transform the input from one format to the other before it is saved.

If you'd like to buy me a coffee or two, thank you very much
lemur 43
April 20 2009, 09:08 #30301
Thanks, Bob.

We have at the same time responded (see my post above).

lemur 43
April 20 2009, 09:28 #30302
Hi, once more.

The only problem with "datetimepicker" format is, that it is fast "impossible" (more as 60 clicks!) to input date as "1950-08-14"

And for "Date (AU) format I have no any solution
(see "Date is not accepted in Form" =