Different buttons having the same function - html

I have this back and confirm button. The problem is that when I click the back button it confirms the form. Basically my back and confirm button are having the same function.
I tried putting the back button outside the and it worked well. The problem is it would look like this:
The thing is I want the back button to go first and then the confirm button next. Like this:
I can only do that when the back button is inside the form. As I've said I'm having problems when I do that.
Here's my html:
.form__confirmation,
.form__confirmation2 {
padding: 0px 0px;
display: inline-block;
}
button {
font-size: 12px;
text-transform: uppercase;
font-weight: 700;
letter-spacing: 1px;
background-color: #011f4b;
border: 1px solid #DADDE8;
color: #fff;
padding: 18px;
border-radius: 5px;
outline: none;
-webkit-transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
left: 330px;
margin-bottom: 20px;
}
button:hover {
background-color: #1293e1;
}
button:active {
background-color: #1083c8;
}
<div class="container">
<div class="card">
<div class="form__name" style="font-family: Questrial; ">
Leave Application Form
</div>
<div class="time__container">
<div class="section">
<div class="box">
1
</div><span>Date & Time</span>
</div>
<form action="form-to-email.php" class="form__time" method="post">
<div class="date">
<label for="date">From</label> <input id="date" type="date" name="datefrom" required>
</div>
<div class="date">
<label for="date">To</label> <input id="date" type="date" name="dateto" required>
</div>
<div class="timezone">
<label for="timezone"></label>
</select>
</div>
</div>
<div class="message__container">
<div class="section">
<div class="box">
2
</div><span>Message</span>
</div>
<textarea cols="50" rows="5" name="message" required></textarea>
</div>
<div class="contact__container">
<div class="section">
<div class="box">
3
</div><span>Contact Information</span>
</div>
<div class="form__contact">
<div class="cname">
<label for="cname">Name</label> <input name="name" type="text" required>
</div>
<div class="cnum">
<label for="cnum">Phone Number</label> <input id="cnum" type="text" name="phoneno" required>
</div>
<div class="email">
<label for="cemail">Email</label> <input id="cemail" name="email" required>
</div>
</div>
</div>
<div class="contact__container">
<div class="section">
<div class="box">
4
</div><span>Send to</span>
</div>
<div class="form__contact">
<div class="cname">
<label for="cname">Manager</label> <select name="emailTo" required>
<option value=""></option>
<option value="email#gmail.com">TestingRenzo</option>
<option value="email#gmail.com">TestingPaul</option>
</select>
</div>
</div>
</div>
<a href="home.php">
<div class="form__confirmation2">
<button>Back</button>
</div>
</a>
<div class="form__confirmation" type="submit" name="submit">
<button>Confirm Information</button>
</div>
</form>
</div>
</div>

Try changing this [horribly invalid] code:
<a href="home.php">
<div class="form__confirmation2">
<button>Back</button>
</div>
</a>
<div class="form__confirmation" type="submit" name="submit">
<button>Confirm Information</button>
</div>
To this [valid] version instead:
<div class="form__confirmation2">
<a class="button" href="home.php">Back</a>
</div>
<div class="form__confirmation">
<button type="submit" name="submit">Confirm Information</button>
</div>
And add the .button class to your CSS:
button,
.button {
...
}
button:hover,
.button:hover {
...
}
button:active,
.button:active {
...
}

Your HTML is somewhat wrong. Try to minimize the DIV tags if you can then you will understand the problem. Also in the submit button DIV tag you have mentioned a wrong bootstrap class if I am not wrong.

You can use float:right in order to change the positioning of your buttons. This will leave your DOM structure intact.
<div class="form__confirmation" type="submit" name="submit" style="float:right;" >
<button>Confirm Information</button>
</div>
</form>
<a href="home.php">
<div class="form__confirmation2" style="float:right;">
<button>Back</button>
</div>
</a>
This is the entire code Snippet.
<div class="container">
<div class="card">
<div class="form__name" style="font-family: Questrial; ">
Leave Application Form
</div>
<div class="time__container">
<div class="section">
<div class="box">
1
</div><span>Date & Time</span>
</div>
<form action="form-to-email.php" class="form__time" method="post">
<div class="date">
<label for="date">From</label> <input id="date" type="date" name="datefrom" required>
</div>
<div class="date">
<label for="date">To</label> <input id="date" type="date" name="dateto" required>
</div>
<div class="timezone">
<label for="timezone"></label>
</select>
</div>
</div>
<div class="message__container">
<div class="section">
<div class="box">
2
</div><span>Message</span>
</div>
<textarea cols="50" rows="5" name="message" required></textarea>
</div>
<div class="contact__container">
<div class="section">
<div class="box">
3
</div><span>Contact Information</span>
</div>
<div class="form__contact">
<div class="cname">
<label for="cname">Name</label> <input name="name" type="text" required>
</div>
<div class="cnum">
<label for="cnum">Phone Number</label> <input id="cnum" type="text" name="phoneno" required>
</div>
<div class="email">
<label for="cemail">Email</label> <input id="cemail" name="email" required>
</div>
</div>
</div>
<div class="contact__container">
<div class="section">
<div class="box">
4
</div><span>Send to</span>
</div>
<div class="form__contact">
<div class="cname">
<label for="cname">Manager</label> <select name="emailTo" required>
<option value=""></option>
<option value="email#gmail.com">TestingRenzo</option>
<option value="email#gmail.com">TestingPaul</option>
</select>
</div>
</div>
</div>
<!-- CHANGED BUTTON TAGS -->
<div class="form__confirmation" type="submit" name="submit" style="float:right;" >
<button>Confirm Information</button>
</div>
</form>
<a href="home.php">
<div class="form__confirmation2" style="float:right;">
<button>Back</button>
</div>
</a>
</div>

Related

How can I change my Javascript code to jQuery code

I've tried to convert my JS code to jQuery however I can't still fix it. Can anyone help me with it?
const content = document.querySelectorAll(".nk-sec-content")
const btnIcon = document.querySelectorAll(".nk-sec-icon")
btnIcon.forEach(btns => {
btns.addEventListener("click", (e) => {
const currentTarget = e.currentTarget
const currentSelected = document.getElementById(currentTarget.dataset.content)
// console.log(currentSelected)
content.forEach(contentItems => {
if (contentItems !== currentSelected) {
contentItems.classList.remove("show")
}
})
currentSelected.classList.add("show")
})
})
.nk-sec-content {
height: 100%;
display: none;
}
.nk-sec-content.show {
display: block;
}
.nk-sec-icon {
width: 30px;
height: 30px;
background: yellow;
}
.nk-sec-icon-l {
display: flex;
gap: 10px;
}
<div class="nk-sec-container-settings">
<div class="nk-sec-icon-l">
<div class="nk-sec-icon _changepassword" data-content="changepassword" data-title="Change Password"></div>
<div class="nk-sec-icon _emailaddress" data-content="emailaddress" data-title="Email Address"></div>
<div class="nk-sec-icon _contactnumber" data-content="contactnumber" data-title="Contact Number"></div>
<div class="nk-sec-icon _company" data-content="company" data-title="Company"></div>
<div class="nk-sec-icon _help" data-content="help" data-title="Help"></div>
</div>
<div class="nk-sec-settings-content">
<div class="nk-sec-content show" id="changepassword">
<!-- <div class="nk-sec-content-title">Change password</div> -->
<div class="nk--sec-container">
<div class="nk-sec-input">
<div class="nk-cp-text">Username</div>
<input type="text" id="username" name="username" value="001637" disabled="">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">Account name</div>
<input type="text" id="accountname" name="accountname" value="" disabled="">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">Old password</div>
<input type="text" id="oldpassword" name="oldpassword">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">New password</div>
<input type="text" id="newpassword" name="newpassword">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">Confirm password</div>
<input type="text" id="confirmpassword" name="confirmpassword">
</div>
<div class="nk-sec-input">
<div class="nk-btn-cpassword">Update password</div>
</div>
</div>
</div>
<div class="nk-sec-content" id="emailaddress">
<!-- <div class="nk-sec-content-title">Add email address</div> -->
<div class="nk--sec-container">
<div class="nk-sec-input">
<div class="nk-cp-text">Email</div>
<input type="text" id="email" name="email" value="" disabled="">
</div>
<div class="nk-sec-input">
<!-- <div class="nk-cp-text">Email</div> -->
<input type="text" id="email" name="email" value="">
</div>
<div class="nk-sec-input">
<div class="nk-btn-cpassword">Add more email</div>
</div>
</div>
</div>
<div class="nk-sec-content" id="contactnumber">
<div class="nk-sec-content-title">Contact number</div>
</div>
<div class="nk-sec-content" id="company">
<div class="nk-sec-content-title">Company</div>
</div>
<div class="nk-sec-content" id="help">
<div class="nk-sec-content-title">Help</div>
</div>
</div>
</div>
This is how you can do it using jQuery.
You just need to see the corresponding methods for jQuery which you used.
Like,
$('') is the query selector
.on('', function) is the event listener
this keyword is used to refer to the current target element
$('').attr('') is used to get the value of attribute of the target
$('').removeClass(''), $('').addClass(''), to remove and add classes
I recommend you to visit the official documentation for better understanding.
$(".nk-sec-icon").on('click', function(event) {
// Get element with id = current clicked div's data-content attribute
const targetDiv = $(`#${$(this).attr("data-content")}`);
// Remove show and add hide in class from all divs with class 'nk-sec-content'
$(".nk-sec-content").removeClass('show');
$(".nk-sec-content").addClass('hide');
// In current clicked button's target remove hide and add show.
targetDiv.removeClass('hide');
targetDiv.addClass('show');
});
.nk-sec-content {
height: 100%;
display: none;
}
.nk-sec-content.show {
display: block;
}
.nk-sec-icon {
width: 30px;
height: 30px;
background: yellow;
}
.nk-sec-icon-l {
display: flex;
gap: 10px;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="nk-sec-container-settings">
<div class="nk-sec-icon-l">
<div class="nk-sec-icon _changepassword" data-content="changepassword" data-title="Change Password"></div>
<div class="nk-sec-icon _emailaddress" data-content="emailaddress" data-title="Email Address"></div>
<div class="nk-sec-icon _contactnumber" data-content="contactnumber" data-title="Contact Number"></div>
<div class="nk-sec-icon _company" data-content="company" data-title="Company"></div>
<div class="nk-sec-icon _help" data-content="help" data-title="Help"></div>
</div>
<div class="nk-sec-settings-content">
<div class="nk-sec-content show" id="changepassword">
<!-- <div class="nk-sec-content-title">Change password</div> -->
<div class="nk--sec-container">
<div class="nk-sec-input">
<div class="nk-cp-text">Username</div>
<input type="text" id="username" name="username" value="001637" disabled="">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">Account name</div>
<input type="text" id="accountname" name="accountname" value="" disabled="">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">Old password</div>
<input type="text" id="oldpassword" name="oldpassword">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">New password</div>
<input type="text" id="newpassword" name="newpassword">
</div>
<div class="nk-sec-input">
<div class="nk-cp-text">Confirm password</div>
<input type="text" id="confirmpassword" name="confirmpassword">
</div>
<div class="nk-sec-input">
<div class="nk-btn-cpassword">Update password</div>
</div>
</div>
</div>
<div class="nk-sec-content" id="emailaddress">
<!-- <div class="nk-sec-content-title">Add email address</div> -->
<div class="nk--sec-container">
<div class="nk-sec-input">
<div class="nk-cp-text">Email</div>
<input type="text" id="email" name="email" value="" disabled="">
</div>
<div class="nk-sec-input">
<!-- <div class="nk-cp-text">Email</div> -->
<input type="text" id="email" name="email" value="">
</div>
<div class="nk-sec-input">
<div class="nk-btn-cpassword">Add more email</div>
</div>
</div>
</div>
<div class="nk-sec-content" id="contactnumber">
<div class="nk-sec-content-title">Contact number</div>
</div>
<div class="nk-sec-content" id="company">
<div class="nk-sec-content-title">Company</div>
</div>
<div class="nk-sec-content" id="help">
<div class="nk-sec-content-title">Help</div>
</div>
</div>
</div>

Do not put the label inline in a form-inline - Bootstrap

I have a form, I have in this two fields inline because they are in a form-inline div, I want to put the label of these above the fields and not next to them. How to remove form-inline from them without affecting the fields?
Here is a CodePen
<main id="contact_part">
<article class="mb-5 row">
<h1>Nous Contacter</h1>
<div class="col-md-12">
<form action="" method="post" id="contact_form">
<div class="form-inline">
<label class="" for="name_contact">Name</label>
<input type="text" class="form-control mb-2 mr-sm-2" id="name_contact" placeholder="Nom" required>
<label class="" for="lastNameContact">Name</label>
<input type="text" class="form-control mb-2 mr-sm-2" id="lastName_contact" placeholder="Prénom" required>
</div>
<div class="form-group">
<label class="" for="email_contact">E-Mail</label>
<input type="email" name="email_contact" id="email_contact" class="form-control" placeholder="E-Mail" required>
</div>
<div class="form-group">
<label class="" for="message_contact">Message</label>
<textarea class="form-control" id="message_contact" placeholder="Message" required></textarea>
</div>
</form>
</div>
</article>
</main>
#contact_part article {
background-color: #FFF989;
font-family: main, "Palatino Linotype", "Book Antiqua", Palatino, serif;
color: #565656;
padding: 50px;
}
#contact_part .row {
display: block;
}
#contact_part h1 {
font-size: 1.7rem;
text-transform: uppercase;
margin-bottom: 3rem;
text-decoration: underline;
text-align: center;
}
#contact_form {
width: 50%;
margin: 0 auto;
}
#contact_form .form-inline label {
}
#contact_form input, #contact_form textarea {
border: none;
border-bottom: 1px solid #C6C6C6;
background-color: #FFF989;
}
If I understand correctly you no need to use form-inline class instead use like below code. Your form will look good.
<main id="contact_part">
<div class="container">
<article class="mb-5 row">
<div class="col-12">
<h1>Nous Contacter</h1>
</div>
<div class="col-12">
<form action="" method="post" id="contact_form">
<div class="row">
<div class="col-12 col-md-6">
<div class="form-group">
<label class="custom-control pl-0" for="name_contact">First Name</label>
<input type="text" class="form-control" id="name_contact" placeholder="First Name" required>
</div>
</div>
<div class="col-12 col-md-6">
<div class="form-group">
<label class="custom-control pl-0" for="lastNameContact">Last Name</label>
<input type="text" class="form-control" id="lastName_contact" placeholder="Last Name" required>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="custom-control pl-0" for="email_contact">E-Mail</label>
<input type="email" name="email_contact" id="email_contact" class="form-control" placeholder="example#example.com" required>
</div>
</div>
<div class="col-12">
<div class="form-group">
<label class="custom-control pl-0" for="message_contact">Message</label>
<textarea class="form-control" id="message_contact" placeholder="Message" rows="5" required></textarea>
</div>
</div>
</div>
</form>
</div>
</article>
</div>
</main>
Code Pen.
Use col-12 instead of col-md-12 class for better performance. Don't use row without container or container-fluid. If you use only row it give you horizontal scroll bar. Your code will look like this.
<div class="container">
<div class="row">
<div class="col-12"></div>
</div>
</div>
Or
<div class="container-fluid">
<div class="row">
<div class="container">
<div class="row">
<div class="col-12"></div>
</div>
</div>
</div>
</div>
Fluid view or 100% Browser width
<div class="container-fluid">
<div class="row">
<div class="col-12">Content</div>
<div class="col-12">Content</div>
<div class="col-12">Content</div>
<div class="col-12">Content</div>
</div>
</div>
Hope this help!
Here you go, let me know if this works: https://codepen.io/luke-richter/pen/XWJVqWO
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
#contact_part{
background-color: #FFF989;
font-family: main, "Palatino Linotype", "Book Antiqua", Palatino, serif;
color: #565656;
padding: 50px;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<!------ Include the above in your HEAD tag ---------->
<main id="contact_part">
<div class="container ">
<div class="row">
<h2>Inline form with heading above inputs</h2>
</div>
<form action="#">
<div class="row">
<div class="col-md-3">
<div class="form-group form-group-sm">
<label for="firstname" class="control-label">Firstname1</label>
<input type="text" class="form-control" id="firstname" placeholder="Firstname">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="lastname" class="control-label">Last Name2</label>
<input type="text" class="form-control" id="lastname" placeholder="Last Name">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="lastname" class="control-label">Last Name3</label>
<input type="text" class="form-control" id="lastname" placeholder="Last Name">
</div>
</div>
</div>
<div class="row">
<div class="col-xs-3">
<textarea class="form-control"></textarea>
</div>
</div>
<div class="row">
<div class="col-xs-3"><br>
<button type="submit" class="btn btn-default">Submit</button>
</div>
</div>
</form>
</div>
</div>
Try this,
.form-inline label
{
margin-bottom:3em;
}
Or You can move the label outside the<div class="form-inline">

How to divide html page

I want to make a html page with three sections and inside each section divide it to left and right. In each section I have three boxes and I want to put two boxes on the left and one box on the right following is the css and html code:
.leftbox {
width: 50%;
padding: 5px;
float: left;
}
.rightbox {
width: 50%;
padding: 5px;
float: right;
}
<div id="rotationFormPopup" class="rotationFormPopup" style="width: 900px; display: none; background: #FFF; border: 1px solid; padding: 10px; margin-top: 100px;">
<h2 class="popup-header">Rotation Forms</h2>
<div class="newRotation-sections">
<h3>Details</h3>
<div class="newRotation-section-1" style="margin-top: 10px;">
<div class="leftbox">
<span>Mob</span> <br />
<input type="text" class="newRotation-mob" style="width: 100%;"><br /><br />
<span>Paddock</span> <br />
<input type="text" class="newRotation-paddock" style="width: 100%;"><br /><br />
</div>
<div class="rightbox">
<span>Date</span> <br />
<input type="text" class="newRotation-date" style="position: relative; display: inline-block; float: left; width: 100%; margin-top: 10px;"><br /><br />
</div>
</div>
<h3>Fencing options</h3>
<div class="newRotation-section-2" style="margin-top: 10px;">
<div class="leftbox">
<span>Available Today</span> <br />
<input type="text" class="newRotation-available" style="width: 100%;"><br /><br />
<span>Paddock Allocation %</span> <br />
<input type="number" class="newRotation-alloc" value="50" style="width: 100%;"><br /><br />
</div>
<div class="rightbox">
<span>Required Result</span> <br />
<input type="text" class="newRotation-result" style="width: 100%;"><br /><br />
</div>
</div>
<h3>Assign As Task</h3>
</div>
</div>
</div>
I receive the below result, I don't know why the fencing options jump to the right side.
Here is the image of my work:
I wrote up this using the Bootstrap Framework. It matches your image exactly.
There's a Codepen if you want to fork and play around with it. It's responsive, too.
/* Roboto Font */
#import url('https://fonts.googleapis.com/css?family=Roboto');
html, body {
height: 100%;
}
body {
font-family: 'Roboto', sans-serif;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<div class="container p-5">
<div class="row">
<div class="col-sm-12">
<h5 class="title text-uppercase bg-success text-white p-1">Rotation Forms</h5>
<h4 class="mb-3 mt-3">Details</h4>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="mob">Mob</label>
<input type="text" class="form-control" id="mob" placeholder="Enter Mob">
</div>
<div class="form-group">
<label for="paddock">Paddock</label>
<input type="text" class="form-control" id="paddock" placeholder="Enter Paddock">
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="date">Date</label>
<input type="date" class="form-control" id="date" placeholder="Enter Date">
</div>
<h4 class="mb-3 mt-3">Fencing Options</h4>
<div class="form-group">
<label for="avail">Available Today</label>
<input type="text" class="form-control" id="avail" placeholder="NaN">
</div>
<div class="form-group">
<label for="allocation">Paddock Allocation %</label>
<input type="number" class="form-control" id="allocation" placeholder="100">
</div>
<div class="form-group">
<label for="result">Required Result</label>
<input type="text" class="form-control" id="result" placeholder="NaN">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-6">
<h4 class="mb-3 mt-3">Assign As Task</h4>
<div class="form-group">
<label for="assign">Assign to</label><br>
<button type="submit" class="btn btn-success btn-md" id="assign">Add</button>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="checked">
<label class="form-check-label" for="checked">I want to see this too.</label>
</div>
<button type="button" class="btn btn-success btn-md">Save</button>
<button type="button" class="btn btn-success btn-md">Cancel</button>
</div>
</div>
</div>

Removing white space on the right side of a page

I am aware this is very basic but I have been trying so many ways of removing the white space on the right side of my page yet still it's been a little problem for me as a learner. The sign_in and paratext are inline as shown but when I used set the margins and paddings to 0 to remove the white space from the right side of my page, the sign in (which is the login form) moves below the paratext instead of staying inline.
Here you go. Hope this helps you.
body {
margin: 0;
padding: 0;
}
.sign_in {
display: inline-block;
width: 55%;
font-size: 3vw;
margin-left: 30px;
}
.paratext {
display: inline-block;
font-size: 3vw;
width: 35%;
color: #008B8B;
}
<html>
<head>
<title>Example</title>
</head>
<body>
<div class="paratext">
<h1>Get ready to sell Smarter, Better, Faster.</h1>
<p>Dosty CRM is the latest e-customer relationship management system being used currently by tech companies. Easy and Secure. </p>
</div>
<div class="sign_in" id="sign_in">
<form (ngSubmit)="submitForm(l)" #l="ngForm">
<h1 style="color:#008B8B; font-weight: 900; font-size: 40px;" > <b>Sign In </b></h1><br>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" placeholder="First Name" [(ngModel)]="login.email" required>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="password" [(ngModel)]="login.password">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<input type="checkbox" value="Remember Me" id="remember_me" >
<label >Remember Me </label>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<p class="text-right"><span class="forgot-password"><a style=" color:#008B8B;" href="#">Forgot password?</a></span></p>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<div class="form-group">
<button class="button" type="submit" style="font-weight: 900; background-color:#008B8B;" ><span>Login </span></button>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<p class="text-right">
<span><a style="color:#008B8B;" href="#">Already a member?</a></span></p>
</div>
</div>
</div>
</form>
</div>
</body>
<html>
I have refactored your code by removing irrelevant row classes and inline styles. You also specified sign_in{width:70%}, but haven't specified what is 100%, so I added body{width:100%}. In addition to that, I commented out certain paddings and margins you can see that in the example below.
body{width: 100%;}
.paratext, h1, a{color:#008B8B;}
h1{
font-weight: 900;
font-size: 40px;
}
.form-group button{
font-weight: 900;
background-color:#008B8B;
}
.sign_in {
width: 70%;
/*margin-right: -30%;*/
}
.paratext {
display: inline-block;
/*padding-top: 250px;*/
font-size: 16px;
word-wrap: break-word;
/*width: 600px;*/
}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<body>
<div class="paratext">
<h1>Get ready to sell Smarter, Better, Faster.</h1>
<p>Dosty CRM is the latest e-customer relationship management system being used currently by tech companies. Easy and Secure.</p>
</div>
<div class="sign_in" id="sign_in">
<form (ngSubmit)="submitForm(l)" #l="ngForm">
<h1>Sign In</h1>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="email">Email</label>
<input type="text" class="form-control" id="email" name="email" placeholder="First Name" [(ngModel)]="login.email" required>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="password" [(ngModel)]="login.password">
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<input type="checkbox" value="Remember Me" id="remember_me">
<label>Remember Me</label>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<p class="text-right forgot-password">Forgot password?</p>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<button class="button" type="submit">Login</button>
</div>
</div>
<div class="col-sm-12">
<div class="form-group">
<p class="text-right">Already a member?</p>
</div>
</div>
</div>
</form>
</div>
</body>
Try this code example in your project and see if the problem remains. If you still have a problem then you need to update you question with the rest of the codebase you have.

bootstrap html equal line spacing

I am using the following code with bootstrap library, but the line spacing are not equal, can anyone help me make the line equally spaced?
https://jsfiddle.net/x82tx4hg/
<div class="col-md-11">
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_name">Name</label>
</div>
<div class="col-xs-9">
<input id="menu_dish_name" name="menu_dish[name]" size="30%" type="text" value="Sinagara">
</div>
</div>
<br>
<br>
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_desc">Desc</label>
</div>
<div class="col-xs-9">
<textarea cols="29%" id="menu_dish_desc" name="menu_dish[desc]"></textarea>
</div>
</div>
<br>
<br>
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_price">Price</label>
</div>
<div class="col-xs-9">
<input id="menu_dish_price" name="menu_dish[price]" size="30%" type="text" value="2.0">
</div>
</div>
<br>
<br>
<div class="form-group">
<div class="col-xs-3">Associate Addon Groups</div>
<div class="col-xs-9">
<input name="menu_dish[addon_groups][]" type="hidden" value="">
<select id="menu_dish_addon_groups" multiple="multiple" name="menu_dish[addon_groups][]" size="3" style="width: 32.5%">
<option selected="selected" value="1">Sodas</option>
<option value="2">Condisment</option>
</select>
</div>
</div>
<br>
<br>
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_image">Image</label>
</div>
<div class="col-xs-9">
<input id="menu_dish_image" name="menu_dish[image]" type="file">
</div>
</div>
</div>
I think you need to structure your markup better. Most of the form-group css relies on a parent selector like .form-inline .form-group or .nav-bar .form-group.
Reference the bootstrap docs and examples too.
When done right, you should not need the <br> tag at all.
EDIT
Upon looking at this again, you are omitting <div class="row">'s between your col elements. Look at the grid syntax for more direction.
.form-group was not containing its floats. You could make it contain them with:
.form-group { overflow: hidden }
You’ll also want to take out the spacing <br> elements. Properly spaced example.
I would take out the breaks and use margins or padding to create the spaces
CSS
.col-md-11 .form-group {
display: block;
clear: both;
padding: 1em 0;
margin-bottom: 0;
}
HTML
<div class="col-md-11">
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_name">Name</label>
</div>
<div class="col-xs-9">
<input id="menu_dish_name" name="menu_dish[name]" size="30%" type="text" value="Sinagara">
</div>
</div>
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_desc">Desc</label>
</div>
<div class="col-xs-9">
<textarea cols="29%" id="menu_dish_desc" name="menu_dish[desc]"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_price">Price</label>
</div>
<div class="col-xs-9">
<input id="menu_dish_price" name="menu_dish[price]" size="30%" type="text" value="2.0">
</div>
</div>
<div class="form-group">
<div class="col-xs-3">Associate Addon Groups</div>
<div class="col-xs-9">
<input name="menu_dish[addon_groups][]" type="hidden" value="">
<select id="menu_dish_addon_groups" multiple="multiple" name="menu_dish[addon_groups][]" size="3" style="width: 32.5%">
<option selected="selected" value="1">Sodas</option>
<option value="2">Condisment</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-xs-3">
<label for="menu_dish_image">Image</label>
</div>
<div class="col-xs-9">
<input id="menu_dish_image" name="menu_dish[image]" type="file">
</div>
</div>
</div>
https://jsfiddle.net/hk51kctn/