Date of birth cart attribute not showing up in order details

Topic summary

A user is experiencing an issue with a custom date of birth field on their Shopify cart page. The field includes JavaScript validation to ensure customers are 18 years or older before checkout.

Current Problem:

  • The date of birth attribute is not being saved or displayed in order details/notes
  • Validation appears to work, but data persistence is failing

Technical Details:

  • Implementation includes both HTML markup and JavaScript code
  • The user wants the birth date saved in order notes for age verification purposes

Status:

  • One respondent (Himanshu7) claims to have identified the issue and made code adjustments
  • However, the forum editor is preventing them from posting the updated code directly
  • They’re requesting to connect separately to share the solution

Resolution: Unresolved - awaiting code fix to be shared through alternative means.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Hey everyone, I’ve implemented a date of birth field into my cart page and added some javascript to validate the date of birth before proceeding to the checkout at we need customers to be over 18 years and over to complete the purchase.

I want the date of birth to also be saved in the order notes, but I just can’t figure out why it won’t save.

Can anyone help me?

Here is the HTML:


This is the Javascript:


Hi,

To resolve this, I have made some adjustment in code. But this editor is not allowing to put the code here.

Please connect further to get the update code.

Regards
Himanshu