Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 973225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:14:52+00:00 2026-05-16T03:14:52+00:00

In my hook form alter, this is the date of birth array: [Birthdate] =>

  • 0

In my hook form alter, this is the date of birth array:

[Birthdate] => Array(
  [#type] => fieldset
  [#title] => Birthdate
  [#weight] => 1
  [profile_birthdate] => Array(
    [#type] => date
    [#title] => Birthdate
    [#default_value] =>
    [#description] => The content of this field is kept private and will not be shown publicly.
    [#required] => 1
  )
)

I have tried:

unset($form['Birthdate']['profile_birthdate']);
     unset($form['Birthdate']);

and that does not work as I still get the “Please enter a valid date of birth” message. I want the field hidden and no message.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:14:53+00:00Added an answer on May 16, 2026 at 3:14 am

    The phrasing of the error message (‘… a valid date…’) hints on this being issued from a form validation function. Depending on how that is written, it might still try to validate the field, even if you removed it successfully from the form.

    If that is the case, you’ll need to either override the validation function with a custom version that does not expect the birthdate field (check the content of $form['#validate'] in your hook_form_alter() implementation). Alternatively, instead of removing the field, you could turn it into '#type' => 'hidden' or '#type' => 'value', and provide a default value that passes validation, but then you’ll end up assigning bogus birth dates, which might not be what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a node form for a custom type. I have organic
I'm intrigued by the idea in this article: Mad Libs Style Form Increases Conversion
Trying to change the node/add form for a specific content type to a multistep
What interrupt would you hook from DOS to get the real-time clock?
I'm inserting a hook in the MFC message loop so that the Qt events
How can I hook up an event to a function name I have defined
I'd like to be able to hook into a 3rd party application to see
I'm creating a low level keyboard hook in c# using SetWindowsHookEx, question is how
I can correctly setup up a windows hook, but I get confused by the
Here's the issue: I have a hook in IE that reacts on WebBrowser.OnNavigateComplete2 event

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.