# Order date

**URL:** <https://community.elfsight.com/t/order-date/115661>\
**Category:** Customization\
**Tags:** form-builder\
**Created:** [April 22, 2025, 9:20am UTC](https://community.elfsight.com/t/order-date/115661 "2025-04-22T09:20:04Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominik1](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@Dominik1](https://community.elfsight.com/u/Dominik1)\
**Post date:** [April 22, 2025, 9:20am UTC](https://community.elfsight.com/t/order-date/115661/1 "2025-04-22T09:20:04Z")

</div>

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:](https://dash.elfsight.com/widget/3b6d3eab-da4d-4d1e-9f9e-b7b88ef29fd0)

Dominik

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [April 22, 2025, 12:35pm UTC](https://community.elfsight.com/t/order-date/115661/3 "2025-04-22T12:35:34Z")

</div>

Yep, it’s possible!

To implement it, I’ve added to your widget a Hidden field Order Date:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/a/1/a13e8c19200d199465150a29dad53fc1f706764d.png)

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 🙂

---

<div class="post-metadata">

**Author:** ![Dominik1](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@Dominik1](https://community.elfsight.com/u/Dominik1)\
**Post date:** [April 22, 2025, 2:30pm UTC](https://community.elfsight.com/t/order-date/115661/4 "2025-04-22T14:30:30Z")

</div>

I’m probably doing something wrong:

 ![grafik](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/f/a/fa227148625d0d415b257980efedddc52293a421.png)

My result:

 ![grafik](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/3/2/32f2b39a4654746a21aad0719e96ae1a28d8871f.png)

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [April 22, 2025, 2:39pm UTC](https://community.elfsight.com/t/order-date/115661/5 "2025-04-22T14:39:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Dominik1](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@Dominik1](https://community.elfsight.com/u/Dominik1)\
**Post date:** [April 22, 2025, 2:53pm UTC](https://community.elfsight.com/t/order-date/115661/6 "2025-04-22T14:53:18Z")

</div>

It works, but can it also be displayed like this (in German)?

 ![grafik](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/4/a/4ae754374a0c7da409a8e2b58f4866903545b3ca.png)

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [April 22, 2025, 3:08pm UTC](https://community.elfsight.com/t/order-date/115661/7 "2025-04-22T15:08:59Z")

</div>

Sure! I’ve replaced the previous JS script with the new one:

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![Dominik1](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@Dominik1](https://community.elfsight.com/u/Dominik1)\
**Post date:** [April 22, 2025, 3:18pm UTC](https://community.elfsight.com/t/order-date/115661/8 "2025-04-22T15:18:23Z")

</div>

![grafik](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/d/d/dd1276e4661c52debc93aae6aff4eef74bd496e4.png)

Unfortunately, it no longer works that way.

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [April 22, 2025, 3:25pm UTC](https://community.elfsight.com/t/order-date/115661/9 "2025-04-22T15:25:33Z")

</div>

Oh, apologies, there was a wrong field id in the code. I’ve adjusted it and everything should be working fine now 🙂

---

<div class="post-metadata">

**Author:** ![Dominik1](https://avatars.discourse-cdn.com/v4/letter/d/bc79bd/32.png) [@Dominik1](https://community.elfsight.com/u/Dominik1)\
**Post date:** [April 22, 2025, 4:30pm UTC](https://community.elfsight.com/t/order-date/115661/10 "2025-04-22T16:30:49Z")

</div>

Perfect. Thank you very much!! 🙂

Is it also possible that the unfilled fields are not sent?

---

<div class="post-metadata">

**Author:** ![Sina](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/sina/32/59970_2.png) [@Sina](https://community.elfsight.com/u/Sina)\
**Post date:** [April 22, 2025, 4:36pm UTC](https://community.elfsight.com/t/order-date/115661/11 "2025-04-22T16:36:34Z")

</div>

Great Solution. 👏  
I can use that too.

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [April 23, 2025, 11:29am UTC](https://community.elfsight.com/t/order-date/115661/12 "2025-04-23T11:29:25Z")

</div>

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](https://community.elfsight.com/t/send-only-filled-fields-from-form-builder/62358).

If any news comes up, we’ll update you in your request thread 🙂
