I have several datepicker fields in the registration form. When a user skips the field, it is automatically save as 0000-00-00 in the table. Is there a way to save it as null when the field is empty?
Last edit: 8 years 4 months ago by krileon. Reason: Added [SOLVED] tag to subject
No, empty date fields will always store as 0000-00-00 and empty datetime fields will store as 0000-00-00 00:00:00. Why do you need it saved as null? We actually do not store null for any fieldtype except on initial user creation. Supporting null store is planned in a much later release of CB as we have to modify how we handle storing field values.
Kyle (Krileon) Community Builder Team Member Before posting on forums:
Read FAQ thoroughly
+
Read our Documentation
+
Search the forums CB links:
Documentation
-
Localization
-
CB Quickstart
-
CB Paid Subscriptions
-
Add-Ons
-
Forge
-- If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
-- If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please
send me a private message
with your thread and will reply when possible!
-- Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
-- My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Gotcha. Thanks for the quick response! I found a work-around for my situation...I was loading the data from the table into a chronoform, and the datepicker in CF was getting a nan error. I just added code within the CF to convert the field to an empty string within the form.