Jee Posted November 8, 2016 Share Posted November 8, 2016 Hi, My form is set to save to a processwire page each time the form is submited but i'm having an issue with the date field and can't find the solution on the forums. The datefield on my page template is set to use today's date as default and i display it on my site when the form was submited. The date field doesn't display anything unless i go edit the page and save it. I tried to add a hidden datefield on my form and relate it with the date field on my page but doesn't work either. Maybe the option (Default to today's date) was not created to save the value but just to display something. Link to comment Share on other sites More sharing options...
flydev Posted November 8, 2016 Share Posted November 8, 2016 Hi Jee, if empty, the inputfield set himself with the right value on the page save(). Doing something like this should work : // set outputformatting to false $page->of(false); // set the date field to an empty string $page->datenow = ''; // save the page, the date field should be updated $page->save(); // set outputformatting to true $page->of(true); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now