drupal - How to hide Date of birth field in overriden form? -


Changes to my hook form, this is the date of birth:

  [birthday] = & Gt; Array ([# type] = & gt; field [[title #]] & gt; birthday [# weight] => 1 [profile_barthamata] => hey ([# type] => date [# Title] = & gt; Birthday [#default_value] = & gt; [#description] = & gt; The contents of this area are kept private and will not be shown publicly. [#required] = & gt; 1 ))  

I have tried:

  unset ($ form ['birthday'] ['profile_birthdate']); Not set ($ form ['birthdate']);  

And that does not work as I still get the "Please valid date of birth" message. I do not want to hide the field and no message

The phrasing of the error message ('... a Valid date ... ') indicates that this form has been released from the formation function. Based on how it is written, it can still try to validate the field, even if you have successfully deleted it from the form.

If so, you will need to override the verification function, a custom version that does not expect the date of birth-date (in your code $ form ['# validate']) Check) hook-form_later () implementation). Alternatively, instead of deleting the field, you should assign it to '# type' = & gt; 'Hidden' or '# type' = & gt; Enter 'value' , and provide a default value that passes through validation, but then you will tell a false date of birth, what you probably want for yourself


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -