This support ticket is created 7 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I need a Date field with multiple instances to automatically populate the Add Another field with the current date/time when the form is submitted. So basically, instead of the user needing to click Add Another and enter todays’ date/time this automatically occurs(a new instance is created) every time the Submit button is clicked. I think it should be possible. I know how to get todays date/time and have it auto-populate the original date field. So I think I just need the Add Another field to automatically open and have today's date also auto-populate that field.
Hello. Thank you for contacting the Toolset support.
As I assume you have repeating/multiple instance date field using types. Now, you want to have the second instance prepopulated with current date/time without clicking on the "add" new button which will create another instance of the field.
You may try to use some jQuery code and trigger click event of the add new button.
=> hidden link
Thanks, tried using jquery trigger but no luck yet: This is the code I see for that Add Another button for this multiple instances date field:
<input type="button" class="js-wpt-repadd wpt-repadd" data-wpt-type="date" data-wpt-id="cred_form_375_1_wpcf-date-of-cycle-completions" value="Add new Date of Cycle Completions">
So now all I need is for that to be auto-populated with today's date! I have the first date field in the instance auto-populating using this in my cred form:
Thanks, that also works to auto-open the Add Another field. I'm just trying to figure out now how to auto-populate it with todays date as I have done with the first instance of this field.
I need to check on your install what I can do that.
Could you please share problem URL?
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Thanks. It's so close. The only issue is that when I click the submit button (Done) it's not saving that new instance. I added a few on the back-end so the field is working but for some strange reason this Edit form isn't allowing that newly opened date field to be saved.