[SOLVED] Date Field

Status
Not open for further replies.

degarrin

Member
Hello. I have a form where I have a date time field that I created and it is set to default to the current date. I want the information to show on the form, but don't want it to be editable to most users. However, when the form is submitting, the field appears blank and the information is uploading to the database as all zeros. I also left the default date_time field that was created when the form was first set up in there as well, and it is also doing the same thing. However, I have a third date field in the form that is not set to default to the current date, and it is saving to the database correctly.

I've tried deleting the field and recreating it, with no luck. I even went so far as to recreate the whole form from scratch, with the same results. I have other forms with multiple date fields and I'm not having any issues.

Here are some of the field settings for the one I built:
Hidden = No
Default to current date = Yes
Always return todays date = No
Allow typing in field = No
Form Add Access = Special
Form Edit Access = Special

Any suggestions would be appreciated. I can give site access if needed, as the form is restricted on the frontend to registered users.

Thanks!
Angela
Degarrin
 
"Default to current" is a default value. Default values are only set on new records.
So if you want to "log" the creation time "default to current" (with add access =superad...) is ok.
If you want to "log" the modification time you have to use "always return today" (which I think is applied to all users, even superads).
 
Okay, that makes sense. However, I'm still having an issue with the main date_time field, the default one that was originally created with the form, loading with all zeros to the database when the form is created (see image). I have no idea why, I'm not having this issue with any other forms.
 

Attachments

  • date_time.JPG
    date_time.JPG
    20.6 KB · Views: 222
If that column has no usable data in it, and you really can't find any difference in the settings to account for it, I'd suggest just deleting it (don't forget to empty the trash and really delete it, say "yes" to dropping the column) and recreate a new date element with the settings you want.

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top