Reputation: 65
made a bootstrap popup with a form field inside. In the W3 editor it works fine. But in my script when i click the modal button, nothing happens. It is a .php file.
searched on the forum and found some topics, but could not find the error.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Exportzendingen</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.css">
<link rel="stylesheet" href="export/datatables.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse ">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Exportzendingen</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Overzicht</a></li>
</ul>
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalNorm">
Zending Toevoegen
</button>
<!-- Modal -->
<div class="modal fade" id="myModalNorm" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">
Zending Toevoegen
</h4>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form action="insert.php" method="post">
<div class="form-group">
<label for="email">Debiteur:</label>
<input type="text" class="form-control" name="deb_nmr" id="debiteur" placeholder="Debiteurnummer invoeren">
</div>
<div class="form-group">
<label for="pwd">Klantnaam:</label>
<input type="text" class="form-control" name="cost_name" id="costname" placeholder="Klantnaam invoeren">
</div>
<div class="form-group">
<label for="pwd">Aantal Pallets:</label>
<input type="text" class="form-control" name="numb_pal" id="numbpal" placeholder="Aantal pallets invoeren">
</div>
<div class="form-group">
<label for="pwd">Totaal gewicht:</label>
<input type="text" class="form-control" name="tot_weight" id="totweight" placeholder="Totaal gewicht invoeren + kg">
</div>
<div class="form-group">
<label for="pwd">PB nummers:</label>
<input type="text" class="form-control" name="pb_s"id="pbs" placeholder="Pakbonnummers invoeren + pb">
</div>
<input type="submit" value="submit">
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</nav>
</body>
</html>
Upvotes: 1
Views: 680
Reputation: 33420
You need to add the bootstrap.min.js
:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Exportzendingen</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</head>
Check it with:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.15/css/jquery.dataTables.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Exportzendingen</a>
</div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Overzicht</a></li>
</ul>
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModalNorm">
Zending Toevoegen
</button>
<div class="modal fade" id="myModalNorm" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal">
<span aria-hidden="true">×</span>
<span class="sr-only">Close</span>
</button>
<h4 class="modal-title" id="myModalLabel">
Zending Toevoegen
</h4>
</div>
<div class="modal-body">
<form action="insert.php" method="post">
<div class="form-group">
<label for="email">Debiteur:</label>
<input type="text" class="form-control" name="deb_nmr" id="debiteur" placeholder="Debiteurnummer invoeren">
</div>
<div class="form-group">
<label for="pwd">Klantnaam:</label>
<input type="text" class="form-control" name="cost_name" id="costname" placeholder="Klantnaam invoeren">
</div>
<div class="form-group">
<label for="pwd">Aantal Pallets:</label>
<input type="text" class="form-control" name="numb_pal" id="numbpal" placeholder="Aantal pallets invoeren">
</div>
<div class="form-group">
<label for="pwd">Totaal gewicht:</label>
<input type="text" class="form-control" name="tot_weight" id="totweight" placeholder="Totaal gewicht invoeren + kg">
</div>
<div class="form-group">
<label for="pwd">PB nummers:</label>
<input type="text" class="form-control" name="pb_s"id="pbs" placeholder="Pakbonnummers invoeren + pb">
</div>
<input type="submit" value="submit">
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default"
data-dismiss="modal">
Close
</button>
</div>
</div>
</div>
</div>
</div>
</nav>
Upvotes: 1