Now, when popup page is opened and we open a datepicker in textbox then it adds
scrollbar to iframe. My date textbox is at the bottom of popup page and I do not want to increase Iframe height. Is there a way we can avoid scrollbar and datepicker is shown beyond popup box.
My date textbox is at the bottom of popup page and I do not want to increase Iframe height
Accroding to your description,as far as I think,you could reduce the datapicker size to fit your iframe.You need to add jquery.ui.css and change font-size in .ui-widget.Besides,you could adjust the textbox margin-top to set at the bottom of popup page.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
But the code given is just a sample and my actual form is having other textboxes above datepicker textbox. You can see below screen:
https://imgur.com/a/PSzbrdb
What I am looking for is either datepicker should open completely in modal box without scrollbar by adjusting datepicker's position or it should go out of modal box to avoid scollbar.
Accroding to your description,as far as I think,if you want to adjust the datepicker's position above on the textbox,you could set 'orientation' top in datepicker.However,the height of iframe must more than the height of datepicker.Of course,it is not possible
to set datepicker out of modal box while the textbox is in the modal.If the height of datapicker is more than the iframe and you don't want to increase the height of the iframe, you could adjust the datepicker's size.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
3 Points
36 Posts
Scrollbar issue : Datepicker in Modal Iframe
Mar 25, 2020 01:39 PM|garybenson|LINK
Hi,
I am using bootstrap datepicker in Iframe which opens in bootstrap modal.
Below is a page which opens modal popup with iframe:
and here is datepicker page which is opened in ifame:
Now, when popup page is opened and we open a datepicker in textbox then it adds scrollbar to iframe. My date textbox is at the bottom of popup page and I do not want to increase Iframe height. Is there a way we can avoid scrollbar and datepicker is shown beyond popup box.
Thank you.
Contributor
3730 Points
1424 Posts
Re: Scrollbar issue : Datepicker in Modal Iframe
Mar 26, 2020 04:13 AM|yij sun|LINK
Hi garybenson,
Accroding to your description,as far as I think,you could reduce the datapicker size to fit your iframe.You need to add jquery.ui.css and change font-size in .ui-widget.Besides,you could adjust the textbox margin-top to set at the bottom of popup page.
More details,you could refer to below codes:
WebForm74.aspx:
Jquery-ui.css:
Result:
More details,you could refer to below article:
https://jqueryui.com/download/all/
Best regards,
Yijing Sun
Member
3 Points
36 Posts
Re: Scrollbar issue : Datepicker in Modal Iframe
Mar 26, 2020 05:02 AM|garybenson|LINK
Hi,
Thanks for looking into my code.
But the code given is just a sample and my actual form is having other textboxes above datepicker textbox. You can see below screen:
https://imgur.com/a/PSzbrdb
What I am looking for is either datepicker should open completely in modal box without scrollbar by adjusting datepicker's position or it should go out of modal box to avoid scollbar.
Thank you.
Contributor
3730 Points
1424 Posts
Re: Scrollbar issue : Datepicker in Modal Iframe
Mar 26, 2020 07:47 AM|yij sun|LINK
Hi garybenson,
Accroding to your description,as far as I think,if you want to adjust the datepicker's position above on the textbox,you could set 'orientation' top in datepicker.However,the height of iframe must more than the height of datepicker.Of course,it is not possible to set datepicker out of modal box while the textbox is in the modal.If the height of datapicker is more than the iframe and you don't want to increase the height of the iframe, you could adjust the datepicker's size.
Since you don't post full codes,I create a demo.
More details,you could refer to below codes:
WebForm74.aspx
<head runat="server"> <title></title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker3.min.css" /> <style> table, th, td { padding: 15px; } table { border-spacing: 30px; } </style> </head> <body> <form id="form1" runat="server"> <table> <tr> <td>Name:<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox></td> </tr> <tr> <td>Age:<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox></td> </tr> <tr> <td>Sex:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td> </tr> <tr> <td>Phone:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td> </tr> <tr> <td>Address:<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td> </tr> <tr> <td>data: <asp:TextBox ID="txtDate" runat="server" CssClass="date-picker"></asp:TextBox></td> </tr> </table> </form> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js"></script> <script> $(document).ready(function () { $('.date-picker').datepicker({ keyboardNavigation: false, forceParse: false, calendarWeeks: false, autoclose: true, clearBtn: true, disableTouchKeyboard: true, orientation: "top left" }) }); </script> </body> </html>
Result:
Best regards,
Yijing Sun
Member
3 Points
36 Posts
Re: Scrollbar issue : Datepicker in Modal Iframe
Mar 26, 2020 03:46 PM|garybenson|LINK
Hi,
Thanks a lot for your help. As per your suggestion I used orientation and also added some CSS to reduce date-picker height.