I would like to add an order date to my order form. Would it be possible for today’s date to appear automatically without having to select the date?
Link to the page with the widget in question:
Dominik
I would like to add an order date to my order form. Would it be possible for today’s date to appear automatically without having to select the date?
Link to the page with the widget in question:
Dominik
Yep, it’s possible!
To implement it, I’ve added to your widget a Hidden field Order Date:
And this code was placed in the Custom JS field on the Settings tab of your widget’s settings:
widget.setFieldValue("[order-date]", new Date().toString());
Please test it out and let me know how it works
This feature will work only when testing from the website, where the widget is installed. Could you please try to send the submission from your website and let me know if it worked?
Sure! I’ve replaced the previous JS script with the new one:
widget.setFieldValue("[order-date]", new Date().toLocaleString('de-DE', {
weekday: 'long',
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZoneName: 'short'
}));
Please check it out and let me know how it works
Oh, apologies, there was a wrong field id in the code. I’ve adjusted it and everything should be working fine now
Perfect. Thank you very much!!
Is it also possible that the unfilled fields are not sent?
Great Solution.
I can use that too.
Unfortunately, it’s impossible to do this now. I see that you’ve already created a request for this feature - Send only filled fields from form builder.
If any news comes up, we’ll update you in your request thread