0

I have a popup form with DOB field. I would like to get Calendar shown when a customer clicks on DOB text field or on click on calendar icon beside DOB field. My HTML is:

<div class="field date field-dob required">
                <label class="label" for="dob"><span>Date of Birth</span></label>
                <div class="control customer-dob">
                    <input type="text" name="dob" id="customer_dob" value="" class="_has-datepicker" data-validate="{required:true}" autocomplete="off" aria-required="true" /><button type="button" class="ui-datepicker-trigger v-middle"><span>Select Date</span></button>
                    <script>
                        require([
                            "jquery",
                            "mage/calendar"
                        ], function($){
                            $("#customer_dob").calendar({
                                buttonText:"<?php echo __('Select Date') ?>",
                            });
                        });
                    </script>
                </div>
            </div>

Screen-shot

  • what you getting in console log using this script? – Camit1dk Jul 17 '17 at 5:40
  • What error are you getting? – Nikunj Vadariya Jul 17 '17 at 6:10
  • @Dhaval I don't get any errors in the console or any logs neither. – Yogesh Agarwal Jul 18 '17 at 5:37
  • @SachinAgarwal, can you please check console log click on your textbox. may be error generate click on – Camit1dk Jul 18 '17 at 5:44
  • @Dhaval, No I can't see any error in Console log – Yogesh Agarwal Jul 18 '17 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.