ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Submitting custom date fields to Safecracker

September 06, 2011 6:46am

Subscribe [2]
  • #1 / Sep 06, 2011 6:46am

    Darren Miller

    103 posts

    Hi

    I’m, working on a front-end form that needs to submit some custom date fields.

    In the CP, the I’m instructing content authors to submit dates as ‘Fixed’ and this gives a value of ‘UTC’ in exp_channel_data in the field_dt_XX fields. This is what we need.

    How can I enforce this on Safecracker submissions? Just including a date field leaves the field_dt_XX value blank which is translating to ‘Localized’ in the CP.

    thanks

  • #2 / Sep 06, 2011 8:30pm

    Dan Decker

    7338 posts

    Darren,

    What you are asking to do is possible, although somewhat “hidden”. I sorted out this very issue for another user recently and you can read the solution here. Let us know if you have any questions regarding that method. It sounds cumbersome, but it does work.

    Cheers,

  • #3 / Sep 07, 2011 3:44am

    Darren Miller

    103 posts

    Thanks Dan

    I’m running submissions through the ‘safecracker_submit_entry_start hook’ already so it’s no problem to inject those values without exposing them in the form.

  • #4 / Sep 07, 2011 8:12am

    Dan Decker

    7338 posts

    Darren,

    Excellent, just make sure to use some method to get the raw field name as outlined in that other post. Each custom field has it’s own raw field name. Let us know if you achieve the results you are looking for.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases