0

I am just starting a new form page using Bootstrap 4 (first time). If I add a closing to the check boxes it breaks the form. Huh?!

Am I missing something here?

There error message asks for more details but I think my question covers it: Why does closing the break the form?

https://codepen.io/DennisJM/pen/EbgpwR

<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-
  to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet" 
 href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
 alpha.6/css/bootstrap.min.css" integrity="sha384-
 rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" 
 crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">
<h3><p class="text-center text-white pt-2 pb-2 pl-0 pr-0" style="background-
   color:#0000FF;">Every Albany County Listing Emailed Instantly*</p></h3>
   <h3><p class="text-center">What do you want in your new home?</p></h3>

<div class="container-fluid">
<form> 
<div class="form-group">  
<div class="row">
<div class="col" style="background-color:orange;">
<p class="text-right"> Bedrooms?</p>
</div>

<div class="col" class="form-check form-check-inline" style="background-
 color:pink;">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" name="Bedroom2" value="1"> 1
</label>      


<div class="form-check form-check-inline">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" name="Bedroom2" value="2"> 2
</label>


<div class="form-check form-check-inline">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" name="Bedroom2" value="3"> 3
</label>



<div class="form-check form-check-inline">
<label class="form-check-label">
<input type="checkbox" class="form-check-input" name="Bedroom2" value="4"> 4
</label>
</div>
</form>
</div>
</div>
<!-- jQuery first, then Tether, then Bootstrap JS. -->
  <script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" 
   integrity="sha384-
   A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" 
  crossorigin="anonymous"></script>
  <script 

  src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" 
  integrity="sha384-
  DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" 
  crossorigin="anonymous"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-
  alpha.6/js/bootstrap.min.js" integrity="sha384-
  vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" 
  crossorigin="anonymous"></script>
 </body>
 </html>
DennisJM
  • 29
  • 1
  • 3

1 Answers1

0

It might depend on how you are closing the tags. It could be because the <input> tag is self-closing. In other words,

Wrong:

<input type="checkbox" value="4">4</input>

Correct (both):

<input type="checkbox" value="4" />4
<input type="checkbox" value="4">4

The visible number 4 is part of the page, not part of content of the <input> tag.

See this answer for more detail: Are (non-void) self-closing tags valid in HTML5?