<h2>fancybox v3.5</h2>
example from <a href="https://l2banners.ru">l2banners.ru</a>
<hr class="my-5" />

<p>
  <a data-fancybox data-touch="false" href="#modal" class="btn btn-primary">Open form</a>
</p>

<div id="modal">
  <div>
   <form action="" class="form">
     <input type="text">
     <br><br>
     <input type="text">
     <br><br>
     <input type="text">
    </form>
  </div>
</div>
#modal {
  display: none;
  width: 100%;
  max-width: 600px;
}

#modal > div {
  max-height: calc(100vh - 100px);
  overflow: auto;
}
$("[data-fancybox]").fancybox({
    beforeShow: function( instance, slide ) {
      $(slide.src).find('input').val('');
    }
});

External CSS

  1. https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.css
  2. https://codepen.io/fancyapps/pen/Kxdwjj.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js
  2. https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.6/dist/jquery.fancybox.min.js