Bootstrap 4 textarea fill remaining 2nd column height - html

so basically i have 2 columns, one with some inputs and one with only a textarea. The problem is that i want the textarea which is in the 2nd column, to fill the remaining height of the first one but i can't get this working. I tried giving textarea an height of 100%.
Here is a pen with an example:
https://codepen.io/anon/pen/BqQMvG
<section class="contact-us">
<div class="container" style="background-color: #D6EEFD">
<div class="p-3">
<h1 class="primary-brand">
Title
</h1>
<p class="primary-brand">
Eam ex scaevola eloquentiam, ex possim torquatos per. Pro an mnesarchum assueverit. Aeque oportere rationibus ei has, unum case ut qui, eum ne hinc eligendi. Nam no harum omnium, id nominavi comprehensam pri.
</p>
<form>
<div class="container">
<div class="row">
<div class="col">
<div class="form-group">
<label for="name-input">Name</label>
<input type="text" class="form-control form-control-lg" id="name-input" aria-describedby="nameHelp">
</div>
<div class="form-group">
<label for="email-input">E-mail</label>
<input type="email" class="form-control form-control-lg" id="email-input" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="phone-input">Phone number</label>
<input type="tel" class="form-control form-control-lg" id="phone-input" aria-describedby="phoneHelp">
</div>
</div>
<div class="col">
<div>
<label for="description-input">How can we help you?</label>
<textarea class="form-control form-control-lg" id="description-input"></textarea>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</section>
What am i missing?

Just use the Bootstrap h-100 class. Remember height:100% only works if the parent has a defined height. Therefore use h-100 on both the inner div and textarea.
https://codepen.io/anon/pen/ePBXKR
<section class="contact-us">
<div class="container" style="background-color: #D6EEFD">
<div class="p-3">
<h1 class="primary-brand">
Title
</h1>
<p class="primary-brand">
Eam ex scaevola eloquentiam, ex possim torquatos per. Pro an mnesarchum assueverit. Aeque oportere rationibus ei has, unum case ut qui, eum ne hinc eligendi. Nam no harum omnium, id nominavi comprehensam pri.
</p>
<form>
<div class="container">
<div class="row">
<div class="col">
<div class="form-group">
<label for="name-input">Name</label>
<input type="text" class="form-control form-control-lg" id="name-input" aria-describedby="nameHelp">
</div>
<div class="form-group">
<label for="email-input">E-mail</label>
<input type="email" class="form-control form-control-lg" id="email-input" aria-describedby="emailHelp">
</div>
<div class="form-group">
<label for="phone-input">Phone number</label>
<input type="tel" class="form-control form-control-lg" id="phone-input" aria-describedby="phoneHelp">
</div>
</div>
<div class="col">
<div class="h-100">
<label for="description-input">How can we help you?</label>
<textarea class="form-control form-control-lg h-100" id="description-input"></textarea>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</section>
The columns (col) will be the same height since Bootstrap 4 uses flexbox.

Related

why clicking on the next button is not showing the content on the next page?

Hello I am new to programming Iam creating a complaint page using bootstrap, css , JavaScript.
when added this css:
.needs-validation fieldset:not(:first-of-type) {display: none;} it not showing the next page content.
I need when the user choose the from option show the the next page
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title> Communication Portal</title>
<!-- CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/style.css" rel="stylesheet">
<style type="text/css">
.needs-validation fieldset:not(:first-of-type) {
display: none;
}
</style>
<!-- FONT -->
<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght#0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600&display=swap" rel="stylesheet">
</head>
<body>
<div class="container d-flex align-items-center min-vh-100"><!-- CONTAINER Starts-->
<div class="row g-0 justify-content-center"><!--- row g-0 justify-content-center Starts-->
<div class="col-lg-4 offset-lg-1 mx-0 px-0"><!-- TITLE Starts -->
<div id="title-container"><!-- title-container Starts-->
<img class="covid-image" src="images/covid-check.png">
<p class="text-justify">Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati molestiae voluptate atque, saepe maxime dolore cumque quidem veniam accusamus nulla commodi aut corporis, totam est molestias sed ea facere. Et?</p>
</div><!-- title-container Ends-->
</div><!-- TITLE Ends -->
<div class="col-lg-7 mx-0 px-0"><!-- FORMS Starts -->
<div class="progress"><!--progress Starts-->
<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="50" class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar" style="width: 0%"></div>
</div>
<div id="qbox-container">
<form class="needs-validation" id="form-wrapper" method="post" action="action.php" name="form-wrapper" novalidate>
<div id="steps-container">
<fieldset>
<div class="step">
<h4>Please Choose Lanuguage | رجاء اختيار اللغة </h4>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input" id="q_1_yes" name="q_1" type="radio" value="Yes">
<label class="form-check-label question__label" for="q_1_yes">Englsih</label>
</div>
<div class="q-box__question">
<input checked class="form-check-input question__input" id="q_1_no" name="q_1" type="radio" value="No">
<label class="form-check-label question__label" for="q_1_no">Arabic</label>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="step">
<h4>Do You want to mention Your Name</h4>
<div class="form-check ps-0 q-box">
<div class="row">
<div class="col">
<div class="q-box__question">
<input class="form-check-input question__input" id="q_2_yes" name="q_2" type="radio" value="Yes">
<label class="form-check-label question__label" for="q_2_yes">Yes</label>
</div>
</div>
<div class="col">
<div class="q-box__question">
<input checked class="form-check-input question__input" id="q_2_no" name="q_2" type="radio" value="No">
<label class="form-check-label question__label" for="q_2_no">No</label>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="step">
<h4>Please Write Your Name and Employee #</h4>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<div class="row">
<div class="col">
<label for="inputEmail4">Employee Name</label>
<input type="name" class="form-control" placeholder="Employee Name">
</div>
<div class="col">
<label for="inputPassword4"> Employee Number # </label>
<input type="text" class="form-control" placeholder="Employee Number #">
</div>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="step">
<h4>Please Select one of the folowing options</h4>
<div class="row">
<div class="col-lg-12">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input q-checkbox" id="q_4_right" name="q_4" type="radio" value="uk">
<label class="form-check-label question__label" for="q_4_right">
Doing the right thing ! <br>
<p class="lead">Reaporting someting you see wrong</p>
</label>
</div>
</div>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input q-checkbox" id="q_4_ideas" name="q_4" type="radio" value="j">
<label class="form-check-label question__label" for="q_4_ideas">Share your Ideas <br>
<p class="lead">Let us know if you have a great suggestion</p></label>
</div>
</div>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input" id="q_4_views" name="q_4" type="radio" value="us">
<label class="form-check-label question__label" for="q_4_views">Air your Views <br>
<p class="lead"> Tell us what's frusting you in the work place</p></label>
</div>
</div>
</div>
</div>
</div>
<div class="step">
<h4>Donig the right thing</h4>
<p>Reporting someting you see wrong
if you see or suspect someone or something being done wrong that is having a negative impact or harming the association please share your concern</p>
<div class="row">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<label for="floatingTextarea2">Comments</label>
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
</div>
</div>
</div>
</div>
<div class="step">
<h4>Share your Ideas</h4>
<p>Did you know some of our best ideas have come from our colleagues? if you thing you have a great idea that can help the assocation to perform better , we would love to hear from you</p>
<div class="row">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<label for="floatingTextarea2">your Ideas!</label>
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
</div>
</div>
</div>
</div>
<div class="step">
<h4>Air your views</h4>
<p>We all work hard and deserve tp be treated well, we have some very good, robst employment and operational policies and procedures to support and protect you,but if there is something that we have done wrong or is frustrating you we would like to hear from you about this , so we can look to the issue and rectify,where possible</p>
<div class="row">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<label for="floatingTextarea2">Your Views</label>
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
</div>
</div>
</div>
</div>
</fieldset>
<div class="step">
<h4>Incident Reported on:</h4>
<div class="row">
<div class="col">
<label class="form-label">REPORTED PERSON</label>
<input type="text" class="form-control" placeholder="Reported Person">
</div>
<div class="col">
<label class="form-label">REPORTED EMPLOYEE #</label>
<input type="text" class="form-control" placeholder="Reported Employee #">
</div>
</div>
<div class="mt-2">
<label class="form-label">INCIDENT TYPE </label>
<select class="form-select" aria-label="Default select example">
<option selected>Select Incident Type</option>
<option value="1">THEFT</option>
<option value="2">NON COMPLIANCE WITH COMPANY POLICY</option>
<option value="3">FRAUD</option>
<option value="3">ABUSING POWER</option>
<option value="3">USING COMPANY PROPERTY FOR PERSONAL INTEREST</option>
<option value="3">NEGLIGENCE</option>
</select>
</div>
<div class="mt-2">
<label for="exampleFormControlTextarea1">INCIDENT DETAILS </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"></textarea>
</div>
<div class="mt-2">
<label class="form-label">INCIDENT CITY</label>
<select class="form-select" aria-label="Default select example">
<option selected>Select Incident City</option>
<option value="1">Beirut</option>
<option value="2">Bekaa</option>
</select>
</div>
<div class="mt-2">
<div class="row">
<div class="col">
<label for="formFileMultiple" class="form-label">UPLOAD ATTACHEMENT </label>
<input class="form-control" type="file" id="formFileMultiple" multiple />
</div>
<div class="col">
<label for="" class="form-label">INCIDENT DATE</label>
</div>
</div>
<div class="mt-4">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault">
<label class="form-check-label" for="flexSwitchCheckDefault">I confirm that, all above provided information is correct.</label>
</div>
</div>
</div>
</div>
<div class="step">
<div class="mt-1">
<div class="closing-text">
<h4>Thank you</h4>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ut omnis explicabo doloribus at iste magni maiores impedit, nam eum reprehenderit facere aliquid ipsa labore sed? Dolorem eveniet recusandae molestiae at.</p>
<p>Click on the submit button to continue.</p>
</div>
</div>
</div>
<div id="success">
<div class="mt-5">
<h4>Success! We'll get back to you ASAP!</h4>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Pariatur deleniti eius ab totam quaerat illo perferendis, eum veritatis rerum tempore impedit. Saepe dolores eligendi eum culpa beatae, id doloribus ipsum.</p>
<a class="back-link" href="">Go back from the beginning ➜</a>
</div>
</div>
</div>
<div id="q-box__buttons">
<button id="prev-btn" type="button">Previous</button>
<button id="next-btn" type="button">Next</button>
<button id="submit-btn" type="submit">Submit</button>
</div>
</form>
</div><!--progress Starts-->
</div><!-- FORMS Ends -->
</div><!--- row g-0 justify-content-center Ends-->
</div><!-- CONTAINER ends -->
<div id="preloader-wrapper"><!-- preloader-wrapper Starts-->
<div id="preloader"></div>
<div class="preloader-section section-left"></div>
<div class="preloader-section section-right"></div>
</div><!-- preloader-wrapper Starts-->
<script src="js/script.js"></script>
</body>
</html>
javascipt
let step = document.getElementsByClassName('step');
let prevBtn = document.getElementById('prev-btn');
let nextBtn = document.getElementById('next-btn');
let submitBtn = document.getElementById('submit-btn');
let form = document.getElementsByTagName('form')[0];
let preloader = document.getElementById('preloader-wrapper');
let bodyElement = document.querySelector('body');
let succcessDiv = document.getElementById('success');
form.onsubmit = () => {
return false
}
let current_step = 0;
let stepCount = 8
step[current_step].classList.add('d-block');
if (current_step == 0) {
prevBtn.classList.add('d-none');
submitBtn.classList.add('d-none');
nextBtn.classList.add('d-inline-block');
}
const progress = (value) => {
document.getElementsByClassName('progress-bar')[0].style.width = `${value}%`;
}
nextBtn.addEventListener('click', () => {
current_step++;
let previous_step = current_step - 1;
if ((current_step > 0) && (current_step <= stepCount)) {
prevBtn.classList.remove('d-none');
prevBtn.classList.add('d-inline-block');
step[current_step].classList.remove('d-none');
step[current_step].classList.add('d-block');
step[previous_step].classList.remove('d-block');
step[previous_step].classList.add('d-none');
if (current_step == stepCount) {
submitBtn.classList.remove('d-none');
submitBtn.classList.add('d-inline-block');
nextBtn.classList.remove('d-inline-block');
nextBtn.classList.add('d-none');
}
} else {
if (current_step > stepCount) {
form.onsubmit = () => {
return true
}
}
}
progress((100 / stepCount) * current_step);
});
prevBtn.addEventListener('click', () => {
if (current_step > 0) {
current_step--;
let previous_step = current_step + 1;
prevBtn.classList.add('d-none');
prevBtn.classList.add('d-inline-block');
step[current_step].classList.remove('d-none');
step[current_step].classList.add('d-block')
step[previous_step].classList.remove('d-block');
step[previous_step].classList.add('d-none');
if (current_step < stepCount) {
submitBtn.classList.remove('d-inline-block');
submitBtn.classList.add('d-none');
nextBtn.classList.remove('d-none');
nextBtn.classList.add('d-inline-block');
prevBtn.classList.remove('d-none');
prevBtn.classList.add('d-inline-block');
}
}
if (current_step == 0) {
prevBtn.classList.remove('d-inline-block');
prevBtn.classList.add('d-none');
}
progress((100 / stepCount) * current_step);
});
submitBtn.addEventListener('click', () => {
preloader.classList.add('d-block');
const timer = ms => new Promise(res => setTimeout(res, ms));
timer(5)
.then(() => {
bodyElement.classList.add('loaded');
}).then(() => {
step[stepCount].classList.remove('d-block');
step[stepCount].classList.add('d-none');
prevBtn.classList.remove('d-inline-block');
prevBtn.classList.add('d-none');
submitBtn.classList.remove('d-inline-block');
submitBtn.classList.add('d-none');
succcessDiv.classList.remove('d-none');
succcessDiv.classList.add('d-block');
})
});
I tried to create the page with out .needs-validation fieldset:not(:first-of-type) {display: none;} but did not work. as I said before I am new
You did everything right in the JS, but this part: needs-validation fieldset:not(:first-of-type) {display: none;} was making everything "invisible".
The changes I've made were:
Remove the above mentioned css;
Add d-none to every-step, except the first one.
let step = document.getElementsByClassName('step');
let prevBtn = document.getElementById('prev-btn');
let nextBtn = document.getElementById('next-btn');
let submitBtn = document.getElementById('submit-btn');
let form = document.getElementsByTagName('form')[0];
let preloader = document.getElementById('preloader-wrapper');
let bodyElement = document.querySelector('body');
let succcessDiv = document.getElementById('success');
form.onsubmit = () => {
return false
}
let current_step = 0;
let stepCount = 8
step[current_step].classList.add('d-block');
if (current_step == 0) {
prevBtn.classList.add('d-none');
submitBtn.classList.add('d-none');
nextBtn.classList.add('d-inline-block');
}
const progress = (value) => {
document.getElementsByClassName('progress-bar')[0].style.width = `${value}%`;
}
nextBtn.addEventListener('click', () => {
current_step++;
let previous_step = current_step - 1;
if ((current_step > 0) && (current_step <= stepCount)) {
prevBtn.classList.remove('d-none');
prevBtn.classList.add('d-inline-block');
step[current_step].classList.remove('d-none');
step[current_step].classList.add('d-block');
step[previous_step].classList.remove('d-block');
step[previous_step].classList.add('d-none');
if (current_step == stepCount) {
submitBtn.classList.remove('d-none');
submitBtn.classList.add('d-inline-block');
nextBtn.classList.remove('d-inline-block');
nextBtn.classList.add('d-none');
}
} else {
if (current_step > stepCount) {
form.onsubmit = () => {
return true
}
}
}
progress((100 / stepCount) * current_step);
});
prevBtn.addEventListener('click', () => {
if (current_step > 0) {
current_step--;
let previous_step = current_step + 1;
prevBtn.classList.add('d-none');
prevBtn.classList.add('d-inline-block');
step[current_step].classList.remove('d-none');
step[current_step].classList.add('d-block')
step[previous_step].classList.remove('d-block');
step[previous_step].classList.add('d-none');
if (current_step < stepCount) {
submitBtn.classList.remove('d-inline-block');
submitBtn.classList.add('d-none');
nextBtn.classList.remove('d-none');
nextBtn.classList.add('d-inline-block');
prevBtn.classList.remove('d-none');
prevBtn.classList.add('d-inline-block');
}
}
if (current_step == 0) {
prevBtn.classList.remove('d-inline-block');
prevBtn.classList.add('d-none');
}
progress((100 / stepCount) * current_step);
});
submitBtn.addEventListener('click', () => {
preloader.classList.add('d-block');
const timer = ms => new Promise(res => setTimeout(res, ms));
timer(5)
.then(() => {
bodyElement.classList.add('loaded');
}).then(() => {
step[stepCount].classList.remove('d-block');
step[stepCount].classList.add('d-none');
prevBtn.classList.remove('d-inline-block');
prevBtn.classList.add('d-none');
submitBtn.classList.remove('d-inline-block');
submitBtn.classList.add('d-none');
succcessDiv.classList.remove('d-none');
succcessDiv.classList.add('d-block');
})
});
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.6.1/dist/css/bootstrap.min.css" rel="stylesheet"/>
<!-- FONT -->
<link href="https://fonts.gstatic.com" rel="preconnect">
<link href="https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght#0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600&display=swap" rel="stylesheet">
</head>
<body>
<div class="container d-flex align-items-center min-vh-100">
<!-- CONTAINER Starts-->
<div class="row g-0 justify-content-center">
<!--- row g-0 justify-content-center Starts-->
<div class="col-lg-4 offset-lg-1 mx-0 px-0">
<!-- TITLE Starts -->
<div id="title-container">
<!-- title-container Starts-->
<img class="covid-image" src="images/covid-check.png">
<p class="text-justify">Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati molestiae voluptate atque, saepe maxime dolore cumque quidem veniam accusamus nulla commodi aut corporis, totam est molestias sed ea facere. Et?</p>
</div><!-- title-container Ends-->
</div><!-- TITLE Ends -->
<div class="col-lg-7 mx-0 px-0">
<!-- FORMS Starts -->
<div class="progress">
<!--progress Starts-->
<div aria-valuemax="100" aria-valuemin="0" aria-valuenow="50" class="progress-bar progress-bar-striped progress-bar-animated bg-success" role="progressbar" style="width: 0%"></div>
</div>
<div id="qbox-container">
<form class="needs-validation" id="form-wrapper" method="post" action="action.php" name="form-wrapper" novalidate>
<div id="steps-container">
<fieldset>
<div class="step">
<h4>Please Choose Lanuguage | رجاء اختيار اللغة </h4>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input" id="q_1_yes" name="q_1" type="radio" value="Yes">
<label class="form-check-label question__label" for="q_1_yes">Englsih</label>
</div>
<div class="q-box__question">
<input checked class="form-check-input question__input" id="q_1_no" name="q_1" type="radio" value="No">
<label class="form-check-label question__label" for="q_1_no">Arabic</label>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="step d-none">
<h4>Do You want to mention Your Name</h4>
<div class="form-check ps-0 q-box">
<div class="row">
<div class="col">
<div class="q-box__question">
<input class="form-check-input question__input" id="q_2_yes" name="q_2" type="radio" value="Yes">
<label class="form-check-label question__label" for="q_2_yes">Yes</label>
</div>
</div>
<div class="col">
<div class="q-box__question">
<input checked class="form-check-input question__input" id="q_2_no" name="q_2" type="radio" value="No">
<label class="form-check-label question__label" for="q_2_no">No</label>
</div>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="step d-none">
<h4>Please Write Your Name and Employee #</h4>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<div class="row">
<div class="col">
<label for="inputEmail4">Employee Name</label>
<input type="name" class="form-control" placeholder="Employee Name">
</div>
<div class="col">
<label for="inputPassword4"> Employee Number # </label>
<input type="text" class="form-control" placeholder="Employee Number #">
</div>
</div>
</div>
</div>
</div>
</fieldset>
<fieldset>
<div class="step d-none">
<h4>Please Select one of the folowing options</h4>
<div class="row">
<div class="col-lg-12">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input q-checkbox" id="q_4_right" name="q_4" type="radio" value="uk">
<label class="form-check-label question__label" for="q_4_right">
Doing the right thing ! <br>
<p class="lead">Reaporting someting you see wrong</p>
</label>
</div>
</div>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input q-checkbox" id="q_4_ideas" name="q_4" type="radio" value="j">
<label class="form-check-label question__label" for="q_4_ideas">Share your Ideas <br>
<p class="lead">Let us know if you have a great suggestion</p>
</label>
</div>
</div>
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<input class="form-check-input question__input" id="q_4_views" name="q_4" type="radio" value="us">
<label class="form-check-label question__label" for="q_4_views">Air your Views <br>
<p class="lead"> Tell us what's frusting you in the work place</p>
</label>
</div>
</div>
</div>
</div>
</div>
<div class="step d-none">
<h4>Donig the right thing</h4>
<p>Reporting someting you see wrong
if you see or suspect someone or something being done wrong that is having a negative impact or harming the association please share your concern</p>
<div class="row">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<label for="floatingTextarea2">Comments</label>
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
</div>
</div>
</div>
</div>
<div class="step d-none">
<h4>Share your Ideas</h4>
<p>Did you know some of our best ideas have come from our colleagues? if you thing you have a great idea that can help the assocation to perform better , we would love to hear from you</p>
<div class="row">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<label for="floatingTextarea2">your Ideas!</label>
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
</div>
</div>
</div>
</div>
<div class="step d-none">
<h4>Air your views</h4>
<p>We all work hard and deserve tp be treated well, we have some very good, robst employment and operational policies and procedures to support and protect you,but if there is something that we have done wrong or is frustrating you we would like to hear from you about this , so we can look to the issue and rectify,where possible</p>
<div class="row">
<div class="form-check ps-0 q-box">
<div class="q-box__question">
<label for="floatingTextarea2">Your Views</label>
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea2" style="height: 100px"></textarea>
</div>
</div>
</div>
</div>
</fieldset>
<div class="step d-none">
<h4>Incident Reported on:</h4>
<div class="row">
<div class="col">
<label class="form-label">REPORTED PERSON</label>
<input type="text" class="form-control" placeholder="Reported Person">
</div>
<div class="col">
<label class="form-label">REPORTED EMPLOYEE #</label>
<input type="text" class="form-control" placeholder="Reported Employee #">
</div>
</div>
<div class="mt-2">
<label class="form-label">INCIDENT TYPE </label>
<select class="form-select" aria-label="Default select example">
<option selected>Select Incident Type</option>
<option value="1">THEFT</option>
<option value="2">NON COMPLIANCE WITH COMPANY POLICY</option>
<option value="3">FRAUD</option>
<option value="3">ABUSING POWER</option>
<option value="3">USING COMPANY PROPERTY FOR PERSONAL INTEREST</option>
<option value="3">NEGLIGENCE</option>
</select>
</div>
<div class="mt-2">
<label for="exampleFormControlTextarea1">INCIDENT DETAILS </label>
<textarea class="form-control" id="exampleFormControlTextarea1" rows="3"></textarea>
</div>
<div class="mt-2">
<label class="form-label">INCIDENT CITY</label>
<select class="form-select" aria-label="Default select example">
<option selected>Select Incident City</option>
<option value="1">Beirut</option>
<option value="2">Bekaa</option>
</select>
</div>
<div class="mt-2">
<div class="row">
<div class="col">
<label for="formFileMultiple" class="form-label">UPLOAD ATTACHEMENT </label>
<input class="form-control" type="file" id="formFileMultiple" multiple />
</div>
<div class="col">
<label for="" class="form-label">INCIDENT DATE</label>
</div>
</div>
<div class="mt-4">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="flexSwitchCheckDefault">
<label class="form-check-label" for="flexSwitchCheckDefault">I confirm that, all above provided information is correct.</label>
</div>
</div>
</div>
</div>
<div class="step d-none">
<div class="mt-1">
<div class="closing-text">
<h4>Thank you</h4>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ut omnis explicabo doloribus at iste magni maiores impedit, nam eum reprehenderit facere aliquid ipsa labore sed? Dolorem eveniet recusandae molestiae at.</p>
<p>Click on the submit button to continue.</p>
</div>
</div>
</div>
<div id="success">
<div class="mt-5">
<h4>Success! We'll get back to you ASAP!</h4>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Pariatur deleniti eius ab totam quaerat illo perferendis, eum veritatis rerum tempore impedit. Saepe dolores eligendi eum culpa beatae, id doloribus ipsum.</p>
<a class="back-link" href="">Go back from the beginning ➜</a>
</div>
</div>
</div>
<div id="q-box__buttons">
<button id="prev-btn" type="button">Previous</button>
<button id="next-btn" type="button">Next</button>
<button id="submit-btn" type="submit">Submit</button>
</div>
</form>
</div>
<!--progress Starts-->
</div><!-- FORMS Ends -->
</div>
<!--- row g-0 justify-content-center Ends-->
</div><!-- CONTAINER ends -->
<div id="preloader-wrapper">
<!-- preloader-wrapper Starts-->
<div id="preloader"></div>
<div class="preloader-section section-left"></div>
<div class="preloader-section section-right"></div>
</div><!-- preloader-wrapper Starts-->
<script src="js/script.js"></script>
</body>
</html>

How to automatic filter other dropdown list LARAVEL

Good days. I have the apply form. I want make automatically change other dropdown list when I select some data from previous.
I want add drop down list before code below by name Country. when I change country below university list change automatically. show only selected country university.
<div class="form-group select">
<div class="styled-select">
<select class="required" name="university_id" required>
<option value="" selected="">Select University</option>
#foreach($universities as $uni)
<option value="{{$uni->id}}">{{$uni->name}}</option>
#endforeach
</select>
</div>
</div>
Full Form code:
#extends('layouts.index')
#section('main')
<link href="/assets/css/skins/square/grey.css" rel="stylesheet">
<link href="/assets/css/wizard.css" rel="stylesheet">
<div id="preloader">
<div data-loader="circle-side"></div>
</div>
<!-- End Preload -->
<div id="form_container" class="clearfix">
<figure>
<img src="/assets/img/logo/uniwasy.png" width="149" height="42" data-retina="true" alt="">
</figure>
<div id="wizard_container">
<div id="top-wizard">
<div id="progressbar"></div>
</div>
<!-- /top-wizard -->
<form action="{{ route('send_admission') }}" method="POST">
#csrf
<div id="middle-wizard">
<div class="step">
<div id="intro">
<figure><img src="/assets/img/wizard_intro_icon.svg" alt=""></figure>
<h1>Apply</h1>
</div>
</div>
<div class="step">
<div class="form-group">
<input type="text" name="full_name" class="form-control required" placeholder="Full name and surname" required>
</div>
<div class="form-group">
<input type="email" name="email" class="form-control required" placeholder="Your Email" required>
</div>
<div class="form-group row">
<div class="col-md-4">
<div class="styled-select">
<select class="required" name="phone_code" required>
#foreach($country_codes as $c)
<option value="{{$c->phonecode}}">{{$c->nicename}}</option>
#endforeach
</select>
</div>
</div>
<div class="col-md-8">
<input type="text" name="phone" class="form-control" placeholder="Your Phone" required>
</div>
</div>
<div class="form-group select">
<div class="styled-select">
<select class="required" name="university_id" required>
<option value="" selected="">Select University</option>
#foreach($universities as $uni)
<option value="{{$uni->id}}">{{$uni->name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group select">
<div class="styled-select">
<select class="required" name="area" required>
<option value="" selected="">Select Area</option>
#foreach($areas as $area)
<option value="{{$area->def_name}}">{{$area->def_name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group select">
<div class="styled-select">
<select class="required" name="degree" required>
<option value="" selected="">Select Degree</option>
#foreach($levels as $level)
<option value="{{json_decode($level->name)->$lang}}" >{{json_decode($level->name)->$lang}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group select">
<div class="styled-select">
<select class="required" name="service" id="service" onchange="updateAgencies()" required>
<option value="" selected="">Select Service</option>
<option value="1" >Basic</option>
<option value="2" >Premium</option>
</select>
</div>
</div>
<div class="form-group select">
<div class="styled-select">
<select class="required" onchange="updateAgencies()" name="city_id" id="city_id" required>
<option value="" selected="" class="select_agency_first">Select Agency Location</option>
#foreach($cities as $city)
<option value="{{$city->id}}" class='city_list city_list_{{ ($city->id==47959) ? 1 : 2 }}' >{{$city->name}}</option>
#endforeach
</select>
</div>
</div>
<div class="form-group select">
<div class="styled-select">
<select class="required" name="agency_id" id="education_apply" required>
<option value="" selected="">Select Agency</option>
{{--
#foreach($agencies as $agency)
<option value="{{$agency->id}}" data-id="{{$agency->id}}" data-city-id={{$agency->city_id}} >{{$agency->name}}</option>
#endforeach
--}}
</select>
</div>
</div>
</div>
</div>
<!-- /middle-wizard -->
<div id="bottom-wizard">
<button type="submit" name="process" class="submit">Submit</button>
</div>
<!-- /bottom-wizard -->
</form>
</div>
<!-- /Wizard container -->
</div>
<!-- /Form_container -->
<!-- Modal terms -->
<div class="modal fade" id="terms-txt" tabindex="-1" role="dialog" aria-labelledby="termsLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="termsLabel">Terms and conditions</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<p>Lorem ipsum dolor sit amet, in porro albucius qui, in <strong>nec quod novum accumsan</strong>, mei ludus tamquam dolores id. No sit debitis meliore postulant, per ex prompta alterum sanctus, pro ne quod dicunt sensibus.</p>
<p>Lorem ipsum dolor sit amet, in porro albucius qui, in nec quod novum accumsan, mei ludus tamquam dolores id. No sit debitis meliore postulant, per ex prompta alterum sanctus, pro ne quod dicunt sensibus. Lorem ipsum dolor sit amet, <strong>in porro albucius qui</strong>, in nec quod novum accumsan, mei ludus tamquam dolores id. No sit debitis meliore postulant, per ex prompta alterum sanctus, pro ne quod dicunt sensibus.</p>
<p>Lorem ipsum dolor sit amet, in porro albucius qui, in nec quod novum accumsan, mei ludus tamquam dolores id. No sit debitis meliore postulant, per ex prompta alterum sanctus, pro ne quod dicunt sensibus.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn_1" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<script>
function updateAgencies(){
let service = document.getElementById('service').value;
let city_list = document.getElementsByClassName('city_list');
for(let h=0;h<city_list.length;h++){
let display_value=( $(city_list[h]).hasClass('city_list_'+service) ) ? 'block' : 'none';
city_list[h].style.display = display_value;
if(display_value=="none"){
$(city_list[h]).prop('selected', false);
}
}
let city_id = document.getElementById('city_id').value;
let url = '/api/update_agencies';
$.ajax({
method:'POST',
url:url,
data: {
'city_id' : city_id,
'service' : service
}
})
.done(updateThem)
.fail(function(data){
})
}
function updateThem(data) {
// clear the previous data
/*
let hide_later = document.getElementsByClassName('hide_later');
for(let h=0;h<hide_later.length;h++){
hide_later[h].style.display = 'none';
// hide_later[h].parentNode.removeChild(hide_later[h]);
}*/
let cities = data.data;
let education_apply = document.getElementById('education_apply');
education_apply.innerHTML="<option value='' selected>Select Agency</option>";
education_apply.value = '';
for(let i=0;i<cities.length;i++){
let option = document.createElement('option');
option.value = cities[i].id;
option.innerText = cities[i].name;
option.className = 'hide_later';
education_apply.append(option)
}
}
</script>
#endsection
Form photo:
Database:
Table name: universities
Tabke name: countries
Please help! Thanks!
create event on change when change the country selection. then write the ajax for get all university to render university selection.

Bootstrap GRID/Layouts

I'm fairly new to bootstrap and I'm kind of struggling with some of the layout settings. I want to create a centered form with a form of tooltip/box to the right that it's inline with the top of the form box. Below is my current form and I'll attach a photo of what I'm trying to achieve. I've been trying for quite a while but the closest I've come is having it centered in the middle of the page or below the existing form.
What I am trying to achieve: (The orange box)
Current html:
<html lang="en">
<head>
<title>Stackoverflow</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row my-3">
<div class="col-1 col-md-2 col-lg-3"></div>
<div class="col-10 col-md-8 col-lg-6 my-3 border">
<!-- Form -->
<form class="border" action="" method="post" class="my-3">
<h1>ABC</h1>
<h2>Lorem ipsum dolor</h2>
<p class="description">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quae, beatae?
Consequuntur qu</p>
<!-- Input fields -->
<div class="form-group">
<label class="sr-only" for="accountNumber">Account number:</label>
<input type="text" class="form-control accountNumber" id="accountNumber"
placeholder="Account number..." name="accountNumber">
</div>
<div class="form-group">
<label class="sr-only" for="email">Email:</label>
<input type="text" class="form-control email" id="email" placeholder="Email..." name="email">
<small id="emailHelpBlock" class="form-text text-muted">Make sure it's your personal email - you
will need to use it for verification to log in.
</small>
</div>
<div class="alert alert-primary" role="alert"> <span class="icon oi oi-info"></span>This will be your username
</div>
<div class="form-group">
<label class="sr-only" for="firstName">First Name <input type="text" class="form-control firstName" id="firstName" placeholder="First name..."
name="firstName"></label>
</div>
<div class="form-group">
<label class="sr-only" for="surname">Surname:</label>
<input type="text" class="form-control surname" id="surname" placeholder="Surname..."
name="surname">
</div>
<div class="form-group">
<label class="sr-only" for="dateOfBirth">Password:</label>
<input type="text" class="form-control dateOfBirth" id="dateOfBirth"
placeholder="Date of birth..." name="dateOfBirth">
<small id="dateOfBirthHelpBlock" class="form-text text-muted">
DD/MM/YYYY
</small>
</div>
<div class="form-group">
<label class="sr-only" for="password">Password:</label>
<input type="password" class="form-control password" id="password" placeholder="Password..."
name="password">
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">I accept the</label>
<span>
Terms and Conditions
</span>
</div>
<button type="submit" class="btn btn-primary btn-block">Signup</button>
</div>
<!-- End input fields -->
</form>
<!-- Form end -->
</div>
<div class="col-1 col-md-2 col-lg-3></div>
</div>
</div>
</body>
Thanks in advance!
I ended up working through my own solution. To solve my problem I made adjustments to the container holding both the form as well as this new box. As can be seen below.
Solution:
<body>
<div class="container h-100 mt-5">
<div class="row h-100 justify-content-center">
<div class="col-10 col-md-8 col-lg-6 ">
<!-- Form -->
<form class="" action="" method="post">
<h1>ABC</h1>
<h2>Lorem ipsum dolor</h2>
<p class="description">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quae, beatae?
Consequuntur qu</p>
<!-- Input fields -->
<div class="form-group">
<label class="sr-only" for="accountNumber">Account number:</label>
<input type="text" class="form-control accountNumber" id="accountNumber"
placeholder="Account number..." name="accountNumber">
<small id="accountNumberHelpBlock" class="form-text text-muted">Check your Welcome Pack or call
us 1800 000 000 for help
</small>
</div>
<div class="form-group">
<label class="sr-only" for="email">Email:</label>
<input type="text" class="form-control email" id="email" placeholder="Email..." name="email">
<small id="emailHelpBlock" class="form-text text-muted">Make sure it's your personal email - you
will need to use it for verification to log in.
</small>
<div class="alert alert-primary" role="alert"> <span class="icon oi oi-info"></span>This will be
your
username</div>
</div>
<div class="form-group">
<label class="sr-only" for="firstName">First Name:</label>
<input type="text" class="form-control firstName" id="firstName" placeholder="First name..."
name="firstName">
<small id="firstNameHelpBlock" class="form-text text-muted">This is the name that is shown on
your Welcome Pack
</small>
</div>
<div class="form-group">
<label class="sr-only" for="surname">Surname:</label>
<input type="text" class="form-control surname" id="surname" placeholder="Surname..."
name="surname">
</div>
<div class="form-group">
<label class="sr-only" for="dateOfBirth">Password:</label>
<input type="text" class="form-control dateOfBirth" id="dateOfBirth"
placeholder="Date of birth..." name="dateOfBirth">
<small id="dateOfBirthHelpBlock" class="form-text text-muted">
DD/MM/YYYY
</small>
</div>
<div class="form-group">
<label class="sr-only" for="password">Password:</label>
<input type="password" class="form-control password" id="password" placeholder="Password..."
name="password">
</div>
<div class="form-group">
<label class="sr-only" for="password2">Confirm Password:</label>
<input type="password" class="form-control password" id="password2"
placeholder="Confirm your password..." name="password">
</div>
<div class="form-group">
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">
I accept the
</label>
<span>
Terms and Conditions
</span>
<button type="submit" class="btn btn-primary float-right">Register for access</button>
</div>
<!-- End input fields -->
</form>
<!-- Form end -->
</div>
</div>
<div class="border col-lg-3 box">
<div class="help1 border-bottom">
<h4><span class="icon oi oi-question-mark"></span>Need some help?</h4>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quasi totam vel, cum reiciendis tenetur
quia ullam soluta. Praesentium minus explicabo ducimus mollitia dolorum, ipsam tenetur, et
voluptatum quae, nostrum atque!
</p>
<p>Lorem ipsum dolor sit amet consectetur, adipisicing elit. Eius, rem. Incidunt molestiae
repellendus
et sunt iure perferendis saepe ipsam.
</p>
</div>
<div class="help2 border-bottom">
<h4 class="mt-2"><span class="icon oi oi-person"></span>Already registered?</h4>
<a href="#" class="btn btn-light btn-sm btn-block mb-3" tabindex="-1" role="button"
aria-disabled="true">Log in
</a>
</div>
<div class="help3">
<h4 class="mt-2"><span class="icon oi oi-person"></span>You're already a ABC customer?</h4>
<a href="#" class="btn btn-light btn-sm btn-block" tabindex="-1" role="button" aria-disabled="true">Log
in to ABC Internet
</a>
</div>
</div>
<script>
</script>
</body>
Have a look at the design , you need the same. because, I was doing the same as you have attached the picture. It is showing me the same in all view.
Their is some mistake, I have highlighted below. please read this for the next time.
First, You have to add Bootstrap CDN in HTML File to use bootstrap classes.
Second, Don't forget to close the tags. Their is no closing tag in many places that's why its design was not showing properly.
Try to write code in format so that you know which closing tag is
missing.
Third, Their is no need to take .h-100 class in body and every div tag or container it automatically. if anywhere you want to less height
then you can use CSS for less height.
<html lang="en">
<head>
<title>Stackoverflow</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row my-3">
<div class="col-1 col-md-2 col-lg-3"></div>
<div class="col-10 col-md-8 col-lg-6 my-3 border">
<!-- Form -->
<form class="border" action="" method="post" class="my-3">
<h1>ABC</h1>
<h2>Lorem ipsum dolor</h2>
<p class="description">Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quae, beatae?
Consequuntur qu</p>
<!-- Input fields -->
<div class="form-group">
<label class="sr-only" for="accountNumber">Account number:</label>
<input type="text" class="form-control accountNumber" id="accountNumber"
placeholder="Account number..." name="accountNumber">
</div>
<div class="form-group">
<label class="sr-only" for="email">Email:</label>
<input type="text" class="form-control email" id="email" placeholder="Email..." name="email">
<small id="emailHelpBlock" class="form-text text-muted">Make sure it's your personal email - you
will need to use it for verification to log in.
</small>
</div>
<div class="alert alert-primary" role="alert"> <span class="icon oi oi-info"></span>This will be your username
</div>
<div class="form-group">
<label class="sr-only" for="firstName">First Name <input type="text" class="form-control firstName" id="firstName" placeholder="First name..."
name="firstName"></label>
</div>
<div class="form-group">
<label class="sr-only" for="surname">Surname:</label>
<input type="text" class="form-control surname" id="surname" placeholder="Surname..."
name="surname">
</div>
<div class="form-group">
<label class="sr-only" for="dateOfBirth">Password:</label>
<input type="text" class="form-control dateOfBirth" id="dateOfBirth"
placeholder="Date of birth..." name="dateOfBirth">
<small id="dateOfBirthHelpBlock" class="form-text text-muted">
DD/MM/YYYY
</small>
</div>
<div class="form-group">
<label class="sr-only" for="password">Password:</label>
<input type="password" class="form-control password" id="password" placeholder="Password..."
name="password">
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">I accept the</label>
<span>
Terms and Conditions
</span>
</div>
<button type="submit" class="btn btn-primary btn-block">Signup</button>
</div>
<!-- End input fields -->
</form>
<!-- Form end -->
</div>
<div class="col-1 col-md-2 col-lg-3></div>
</div>
</div>
</body>

How to add an html form in the middle of jumbotron using bootstrap 4.1?

I am trying to use twitter-Bootstrap 4.1 to create a website. I have a jumbotron with a background image that takes 75% of the screen on the top. At the bottom, I have text blocks as demonstrated in the following code snippet https://www.codeply.com/go/NnUx8ZDmyz
However, I have the following problems with it. On my screen, the "Search" button is sticking out of the container/card (transparent/gray block). Also when you change the viewport to tablet/ phone size, it gets worst as the form overlaps the text below.
Here is a screenshot of how the form is not centered and the button is sticking out.
Here is a screenshot of how the search form is overlapping with the text below.
UPDATED
Here is a code snippet where the issues above are fixed. However, the search box is now shifted to the top of the jumbotron instead of the middle.
https://www.codeply.com/go/LjMrId9guW
The search button is sticking out because it's bigger than it's container the col-lg-1.
To resolve the overlapping on mobile/tablet screen you'll have to override or remove the h-75 class from: jumbotron jumbotron-fluid intro-jumbotron h-75 clearfix.
I've cleaned up your HTML code a bit:
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="" aria-expanded="false" aria-label="Toggle navigation">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">MySite</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav mr-auto">
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
<li class="nav-item"><a class="nav-link" href="/Home/About">About</a></li>
<li class="nav-item"><a class="nav-link" href="/Home/Contact">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="nav-item"><a class="nav-link" href="/Identity/Account/Register">Register</a></li>
<li class="nav-item"><a class="nav-link" href="/Identity/Account/Login">Login</a></li>
</ul>
</div>
</div>
</nav>
<div class="jumbotron jumbotron-fluid intro-jumbotron clearfix" id="images_show_case">
<div class="container h-100 d-flex">
<div class="my-auto w-100">
<div class="card card-intro-search">
<div class="card-body text-center">
<h3 class="text-uppercase">discover real estate in</h3>
<h1 class="text-uppercase font-weight-bold">My City</h1>
<form method="get" action="/Listing/Search">
<div class="row mx-0">
<div class="col-lg-3 px-0">
<select class="form-control form-control-lg" data-val="true" data-val-required="The Value field is required." id="Search_Type_Value" name="Search.Type.Value"><option value="">Select an option</option>
<option value="CommercialLease">Commercial Lease</option>
<option value="Commerical">Commerical</option>
<option value="LotsAndLand">Lots and Land</option>
<option value="Rental">Rental</option>
<option selected="selected" value="Residential">Residential</option>
<option value="ResidentialIncome">Residential Income</option>
</select>
<label class="control-label search-label" for="Search_Type">Property Type</label>
</div>
<div class="col-lg-3 px-0">
<div class="row mx-0">
<div class="col-lg-6 px-0">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-number="The field Min Price must be a number." data-val-range="The field Min Price must be between 0 and 9999999." data-val-range-max="9999999" data-val-range-min="0" data-val-required="The Min Price field is required." id="Search_MinPrice" name="Search.MinPrice" value="200000" />
<label class="control-label search-label" for="Search_MinPrice">Min Price</label>
</div>
<div class="col-lg-6 px-0">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-number="The field Max Price must be a number." data-val-range="The field Max Price must be between 0 and 9999999." data-val-range-max="9999999" data-val-range-min="0" data-val-required="The Max Price field is required." id="Search_MaxPrice" name="Search.MaxPrice" value="500000" />
<label class="control-label search-label" for="Search_MaxPrice">Max Price</label>
</div>
</div>
</div>
<div class="col-lg-1 pl-0 pr-0">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-range="The field Min Beds must be between 0 and 100." data-val-range-max="100" data-val-range-min="0" id="Search_MinBedrooms" name="Search.MinBedrooms" value="3" />
<label class="control-label search-label" for="Search_MinBedrooms">Min Beds</label>
</div>
<div class="col-lg-1 pl-0 pr-0">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-range="The field Min Baths must be between 0 and 100." data-val-range-max="100" data-val-range-min="0" id="Search_MinBathrooms" name="Search.MinBathrooms" value="2" />
<label class="control-label search-label" for="Search_MinBathrooms">Min Baths</label>
</div>
<div class="col-lg-2 pl-0 pr-0">
<select class="form-control form-control-lg" id="Search_City_Id" name="Search.City.Id"><option value="">Any City</option>
<option value="6">A</option>
<option value="7">B</option>
<option value="8">C</option>
<option value="3">D</option>
<option value="1">E</option>
<option value="2">F</option>
</select>
<label class="control-label search-label" for="Search_City">City</label>
</div>
<div class="col-lg-2 px-0 text-left ">
<button type="submit" value="Search" class="btn btn-primary btn-lg w-100">
<span class="fas fa-filter"></span> Search
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="container-fluid body-content">
<div class="row">
<div class="col-xs-12 col-sm-6 col-lg-4">
<h2>Lorem</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-xs-12 col-sm-6 col-lg-4">
<h2>Lorem</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<div class="col-xs-12 col-sm-6 col-lg-4">
<h2>Lorem</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
</div>
</div>
I moved the min and max price into a col-3. Now the search button wrapper can have a col-2 class.
The solution for the update:
Add to the jumbotron d-flex, remove d-flex from its child and add align-self-center.
<div class="jumbotron jumbotron-fluid intro-jumbotron mh-75 clearfix d-flex" id="images_show_case">
<div class="container h-100 align-self-center">
Tip: istead of pl-0 pr-0 you an use: px-0 (padding on x axis = 0)
You should use min-height:75% instead
.mh-75 {
min-height: 75%;
}
Instead of using pr-0 pl-0 just use no-gutters on the row...
<div class="jumbotron jumbotron-fluid intro-jumbotron mh-75 clearfix" id="images_show_case">
<div class="container h-100 d-flex">
<div class="my-auto">
<div class="card card-intro-search">
<div class="card-body text-center">
<h3 class="text-uppercase">discover real estate in</h3>
<h1 class="text-uppercase font-weight-bold">My City</h1>
<form method="get" action="/Listing/Search">
<div class="row no-gutters">
<div class="col-lg-3">
<select class="form-control form-control-lg" data-val="true" data-val-required="The Value field is required." id="Search_Type_Value" name="Search.Type.Value">
<option value="">Select an option</option>
<option value="CommercialLease">Commercial Lease</option>
<option value="Commerical">Commerical</option>
<option value="LotsAndLand">Lots and Land</option>
<option value="Rental">Rental</option>
<option selected="selected" value="Residential">Residential</option>
<option value="ResidentialIncome">Residential Income</option>
</select>
<label class="control-label search-label" for="Search_Type">Property Type</label>
</div>
<div class="col-lg-2">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-number="The field Min Price must be a number." data-val-range="The field Min Price must be between 0 and 9999999." data-val-range-max="9999999" data-val-range-min="0" data-val-required="The Min Price field is required."
id="Search_MinPrice" name="Search.MinPrice" value="200000">
<label class="control-label search-label" for="Search_MinPrice">Min Price</label>
</div>
<div class="col-lg-2">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-number="The field Max Price must be a number." data-val-range="The field Max Price must be between 0 and 9999999." data-val-range-max="9999999" data-val-range-min="0" data-val-required="The Max Price field is required."
id="Search_MaxPrice" name="Search.MaxPrice" value="500000">
<label class="control-label search-label" for="Search_MaxPrice">Max Price</label>
</div>
<div class="col-lg-1">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-range="The field Min Beds must be between 0 and 100." data-val-range-max="100" data-val-range-min="0" id="Search_MinBedrooms" name="Search.MinBedrooms" value="3">
<label class="control-label search-label" for="Search_MinBedrooms">Min Beds</label>
</div>
<div class="col-lg-1">
<input type="number" class="form-control form-control-lg" data-val="true" data-val-range="The field Min Baths must be between 0 and 100." data-val-range-max="100" data-val-range-min="0" id="Search_MinBathrooms" name="Search.MinBathrooms" value="2">
<label class="control-label search-label" for="Search_MinBathrooms">Min Baths</label>
</div>
<div class="col-lg-2">
<select class="form-control form-control-lg" id="Search_City_Id" name="Search.City.Id">
<option value="">Any City</option>
<option value="6">A</option>
<option value="7">B</option>
<option value="8">C</option>
<option value="3">D</option>
<option value="1">E</option>
<option value="2">F</option>
</select>
<label class="control-label search-label" for="Search_City">City</label>
</div>
<div class="col-lg-1 text-left">
<button type="submit" value="Search" class="btn btn-primary btn-lg">
<span class="fas fa-filter"></span> Search
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
https://www.codeply.com/go/avwMFtM5Cd

How to center align a form with labels inside div

I want to center align a form with labels inside div.login__box
I use bootstrap 3.3.7
That's how I want it
<form class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2" for="login">логин</label>
<div class="col-sm-8">
<input type="login" class="form-control" id="login" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd" >пароль</label>
<div class="col-sm-8">
<input type="password" class="form-control" id="pwd" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="btn" />
<div class="col-sm-4">
<input type="button" class="form-control login__btn-login" id="btn" value="войти в личный кабинет">
</div>
</div>
</form>
My current markup is here
codepen.io
Slight changes made to your html:
<head>
<meta charset="UTF-8">
<title>#</title>
<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css'>
</head>
<body>
<div class="jumbotron vertical-center">
<div class="container">
<div class="row">
<div class="col-md-4 about__box">
<div class="about__inner">
<div class="about__content">
<div class="about__header">Lorem ipsum dolor sit amet, consectetur adipiscing elit</div>
<div class="about__desc">sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</div>
</div>
</div>
</div>
<div class="col-md-8 login__box">
<div class="login__inner">
<div class="text-center login__header">
Authorization
</div>
<div class="container login__container">
<form class="form-horizontal">
<div class="form-group">
<label class="control-label col-sm-2 col-sm-offset-2" for="login">log in</label>
<div class="col-sm-6">
<input type="login" class="form-control" id="login" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-sm-offset-2" for="pwd" >password</label>
<div class="col-sm-6">
<input type="password" class="form-control" id="pwd" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2 col-sm-offset-2" for="btn" ></label>
<div class="col-sm-4">
<input type="button" class="form-control login__btn-login" id="btn" value="submit">
</div>
</div>
</form>
<div class="control-label col-sm-2"></div>
<div class="col-sm-8 login__desc">
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
<img src="" class="pull-right img-responsive login__img_people">
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
</body>
Add this to your css:
.form-horizontal .control-label{
margin-right:0;
}
Attaching codepen linksas well:
http://codepen.io/Sky-123/pen/WGOOqq?editors=1100
Hope this helps!!
add an margin-right:auto and margin-left:auto to .login__inner and you must set the width :
.login__inner{
width: 90%;
margin-left: auto;
margin-right: auto;
}
just add class col-lg-3-offset to the form
<form class="form-horizontal col-lg-3-offset col-lg-6">
<div class="form-group">
<label class="control-label col-sm-2" for="login">логин</label>
<div class="col-sm-8">
<input type="login" class="form-control" id="login" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="pwd" >пароль</label>
<div class="col-sm-8">
<input type="password" class="form-control" id="pwd" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="btn" />
<div class="col-sm-4">
<input type="button" class="form-control login__btn-login" id="btn" value="войти в личный кабинет">
</div>
</div>
</form>