Title: Validate rules and reactdatepicker configuration
Last modified: March 4, 2025

---

# Validate rules and reactdatepicker configuration

 *  Resolved [ger0me](https://wordpress.org/support/users/ger0me/)
 * (@ger0me)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/validate-rules-and-reactdatepicker-configuration/)
 * Hi.
 * I’m having trouble customizing a donation form.
   I need to add two fields to it.
   One to register for a donor’s birthday.And a second one to register the ID number
   of the donor.Before proceeding with the donation, both fields have to be checked
   to verify that the donor is over 18. Some numbers in the ID value must match 
   the month and year of the birthday value.
 * So far, I have created 2 custom fields : date and text :
 *     ```wp-block-code
       add_action('givewp_donation_form_schema', static function (Give\Framework\FieldsAPI\DonationForm $form) {// birthday$field_date = Give\Framework\FieldsAPI\Date::make('birthday')->showInReceipt()->label('Birthday')->placeholder('01/01/1970') // placeholder not working on date field by the way->dateFormat('dd/mm/yyyy')->required()// ->rules()->showInAdmin();// id$field_id_num = Give\Framework\FieldsAPI\Text::make('id_num')->showInReceipt()->label('ID Number')->placeholder('95052125896')->required()->maxLength(11)->minLength(11)->showInAdmin();$form->insertBefore('donationAmount', $field_date);$form->insertAfter('birthday', $field_id_num);});
       ```
   
 * I’m currently stuck to limit birthday selection to years overs 18 and to check
   the values.
 * reactdatepicker, used in the date field, is able to exclude date intervals:
   [https://reactdatepicker.com/#example-exclude-date-intervals](https://reactdatepicker.com/#example-exclude-date-intervals)**
   How could I “override” the default configuration to achieve this?**
 * It seems that Give has tools to validate rules (->rules() / HasValidationRules),
   but I can’t find resources to make it work.
   I also tried to load a custom javascript
   to the form to check values this way, but I only managed to load it on the confirmation
   step.**Could you, please, describe how to use the validation rules and/or to 
   enqueue a custom script on the form?**
 * Kind regards.
   Gérôme
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fvalidate-rules-and-reactdatepicker-configuration%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [Robin Joshua Del Mundo](https://wordpress.org/support/users/robindelmundo/)
 * (@robindelmundo)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/validate-rules-and-reactdatepicker-configuration/#post-18371304)
 * Hi [@ger0me](https://wordpress.org/support/users/ger0me/) ,
 * Please excuse the slow turnaround here.
 * Since this is custom development, the best platform to ask this is on our Github
   discussions page in here — [https://github.com/impress-org/givewp/discussions](https://github.com/impress-org/givewp/discussions),
   as you can get feedback directly from our developers.
 * I’m marking this one as resolved, but please post this inquiry in there.
 * Thank you for using GiveWP!
 * Have a lovely day.
 *  Thread Starter [ger0me](https://wordpress.org/support/users/ger0me/)
 * (@ger0me)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/validate-rules-and-reactdatepicker-configuration/#post-18372350)
 * Hi [@robindelmundo](https://wordpress.org/support/users/robindelmundo/)
 * I did and received an answer [on github](https://github.com/impress-org/givewp/discussions/7772).
 * Kind regards.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Validate rules and reactdatepicker configuration’ is closed to new replies.

 * ![](https://ps.w.org/give/assets/icon-256x256.jpg?rev=2873287)
 * [GiveWP - Donation Plugin and Fundraising Platform](https://wordpress.org/plugins/give/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/give/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/give/)
 * [Active Topics](https://wordpress.org/support/plugin/give/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/give/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/give/reviews/)

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [rules](https://wordpress.org/support/topic-tag/rules/)

 * 2 replies
 * 2 participants
 * Last reply from: [ger0me](https://wordpress.org/support/users/ger0me/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/validate-rules-and-reactdatepicker-configuration/#post-18372350)
 * Status: resolved