bootstrap-4

Remove :valid pseudo class from inputs with Javsacript

谁说胖子不能爱 提交于 2019-12-19 04:08:29
问题 I have a form with multiple sections. Each section is validated manually using Bootstrap 4 validation (without submitting the form for real). This works fine with the code below; let eventCreationForm = $(".event-creation-form"); if (!eventCreationForm[0].checkValidity()) { eventCreationForm.find(":submit").click(); } However, I only want to highlight the inputs that are invalid. I.e, don't highlight valid inputs in green. Rather than overwrite the bootstrap styles for this, I figured I would

Make table header fixed when scrolling

人盡茶涼 提交于 2019-12-19 03:44:15
问题 I am using Bootstrap V4 alpha 6 along with Angular 5 to create a table with a fixed header when scrolling. However, I can't seem to get it to work. Note: The navbar is fixed-top Things I've tried: 1) Add fixed-top class to thead . 2) thead { position: sticky; top: 0; } 3) thead { display:block; } 4) Lots of CSS but nothing works because the table is responsive and scrollable and there are multiple header rows. What am I doing wrong? <nav class="navbar navbar-toggleable-md navbar-inverse fixed

How to hide element on small screens with Bootstrap 4 Beta

纵饮孤独 提交于 2019-12-18 15:48:31
问题 I just moved from bootstrap 4 alpha to beta, but I can't figure out how to hide an element on a small screen now. In the alpha this was "hidden-md-up" and "hidden-sm-down" which worked beautifully. "hidden-md-up" is now "d-md-none", but the other one I can't get to work <div class="d-md-block d-xs-none d-sm-none">Show on large screen only - NOT working for me</div> <div class="d-md-none">Show on small screen only</div> Any ideas? 回答1: A short break, cup of coffee later I figured it out:

How to center navbar in Bootstrap 4 using Flexbox

旧街凉风 提交于 2019-12-18 13:37:12
问题 Well, I want to achieve this thing: https://i.imgur.com/BDM7JvD.jpg using the Bootstrap 4 Navbar. How can I centralize the nav-links/items in the middle of the viewport using the flexbox or .mr-auto etc utilities. I am trying to avoid a CSS based positioning approach because it may look off on different devices. But sure if a CSS approach promises to be at the same centralized position then why not! NOTE: some ppl might say to use the justify utilities, the problem is you can't use them as

Bootstrap 4 dropdown with search

為{幸葍}努か 提交于 2019-12-18 13:22:26
问题 How to implement the data-live-search="true" in bootstrap 4 dropdown? Below link contained a good explanation, however it was for Bootstrap 3. Bootstrap 3 select 回答1: I could not find a standard control and had 0 intention to use a library such as bootstrap select so I custom made this widget. Bootstrap 4 allows you to add forms inside your dropdown which is what I have used here. I added a search box, used an input event to capture the text entered by the user inside the box, If the phrase

datatables add class to filters

爱⌒轻易说出口 提交于 2019-12-18 13:16:04
问题 I am currently seeking a method to add an additional custom class to the jQuery datatables filters ( Records per page and Search ) These items render as follow: <div id="DataTables_Table_0_length" class="dataTables_length"> <label> <select size="1" name="DataTables_Table_0_length" aria-controls="DataTables_Table_0"> <option value="10" selected="selected">10</option> <option value="25">25</option><option value="50">50</option> <option value="100">100</option> </select> records per page </label

Bootstrap 4 - hidden classes - only hide on small screens

主宰稳场 提交于 2019-12-18 11:25:27
问题 How to hide span content only on small (sm) screens? I need this content visible on xs screens. <span class="hidden-sm-down">Text</span> There is a way to do this using only bootstrap classes or not? 回答1: With Bootstrap 4 Beta 1, you can hide sm only with d-block d-sm-none d-md-block . https://code.luasoftware.com/tutorials/bootstrap/bootstrap-hide-element-based-on-viewport-size/ 回答2: There is an upcoming update for Bootstrap 4 that will enable hidden on a single viewport ( hidden-x ).. https

Bootstrap 4 Collapse show state with Font Awesome icon

微笑、不失礼 提交于 2019-12-18 11:09:06
问题 I have a single Bootstrap 4 collapse as follows... <a data-toggle="collapse" href="#collapseNEWS" aria-expanded="true" aria-controls="collapseNEWS"><i class="fa fa-chevron-circle-up" aria-hidden="true"></i></a> <div class="row collapse in" id="collapseNEWS">Content</div> This automatically displays the content unless the font awesome icon is clicked. I am displaying the fa-chevron-circle-up icon upon initial load. Once the icon is clicked, the content closes and I'd like to show the fa

Rectangle using bootstrap

纵然是瞬间 提交于 2019-12-18 09:48:36
问题 I am new to HTML, CSS and bootstrap and trying to make a page something like this. .............................................................................................................................................................. Header .............................................................................................................................................................. And after this Header I need a rectangle in my page with some text and a button.

Several issues with angular formarray form such as input fields behaving inproperly , angular material not working

不羁岁月 提交于 2019-12-18 09:47:26
问题 I am using an angular formarray to store dynamic data in the database. But there are several issues with it such as input fields are taking only one digit at a time and angular material components not working on that page. The same code is working on other pages. If I remove formcontrolname from input fields, they are working fine. Any idea why this is happening? Thanks in advance Here is my code ts get vendor_mobile() { return this.purchaseform.get('vendor_mobile') } get product() { return