0

I need to always show calendar popup in div below input with datepicker. There is my code

<div class="field date">
            <input type="text" name="datepicker" id="datepicker" value="" class="datepicker">
            <script>
                require(["jquery", "mage/calendar"], function($){
                    $("#datepicker").datepicker({
                        showMonthAfterYear: false,
                        dateFormat:'mm/dd/yy',
                        changeMonth: false,
                        changeYear: false,
                        firstDay: 0,
                        showsTime: false,
                        hideIfNoPrevNext: true,
                        minDate: new Date(),
                        yearRange: '2020:2025',
                    })
                });
            </script>
        </div>

How can i do this? Thanks

0

assign datepicker to a <div> instead of an input box.

<div id="datepicker"></div>

<script>
    $(function() {
        $("#datepicker").datepicker();
    });
</script>
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.