Action sur bouton non prise en compte
Bonjour, je souhaite trouver une solution a un problème que j'essaye de résoudre mais j'ai pas trouver de solution
quand je clique sur bouton valider rien ne se passe
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorator="template2">
<head>
<meta charset="UTF-8" />
<!--<script src="/bootstrap.min.js" type="text/javascript"></script>-->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function(){
var a;
$('.table .eBtn').on('click',function(event){
event.preventDefault();
var href=$(this).attr('href');
$.get(href,function(declaration){
$('.modal #id').val(declaration.id);
a=declaration.id;
var x='th:href="@{/valider(id='+a+')}"';
$('#aze').replaceWith('<a '+x+' class="btn btn-primary b">valider</a>');
$('.modal #id2').val(declaration.id);
$('.modal #nom').val(declaration.user.nom);
$('.modal #description').val(declaration.description);
$('.modal #date').val(declaration.dateIncident);
$('.modal #autrePersonne').val(declaration.autrePersonne);
});
$('.modal ').modal();
});
});
</script>
<title>liste de incidents</title>
</head>
<body>
<div layout:fragment="content">
<div class="col-lg-10">
<div class="panel panel-primary">
<div class="panel-heading"> Liste des Declarations</div>
<div class="panel-body">
<div></div>
<table class="table table-striped">
<tr>
<th>ID</th><th>Matricule</th><th>DateIncident</th><th>Description</th><th>autre personne</th><th>Etat</th><th>Detail</th>
</tr>
<tr th:each="i:${listeDeclaration}">
<td th:text="${i.id}" ></td>
<td th:text="${i.user.matricule}"></td>
<td th:text="${i.dateIncident}"></td>
<td th:text="${i.description}"></td>
<td th:text="${i.autrePersonne}"></td>
<td th:text="${i.etat}" style="color: #ffcc33"></td>
<td><a th:href="@{/findd(id=${i.id})}" class="btn btn-primary eBtn" >Detail</a></td>
</tr>
</table>
<div class="container">
<ul class="nav nav-pills">
<li th:each="p,status:${pages}">
<a th:href="@{/liste(page=${status.index})}" th:text="${status.index}"></a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" th:id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" th:id="exampleModalLabel">Infos</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form action="">
<div class="form-group" >
<label for="recipient-name" class="col-form-label">N°:</label>
<input type="text" class="form-control" id="id"/> <input type="hidden" id="id2" name="aaa"/>
</div>
<div class="form-group">
<label for="recipient-name" class="col-form-label">Declarer par:</label>
<input type="text" class="form-control" id="nom"/>
</div>
<div class="form-group">
<label for="message-text" class="col-form-label">date d'incident: </label>
<textarea class="form-control" th:id="date"></textarea>
</div>
<div class="form-group">
<label for="message-text" class="col-form-label">Description:</label>
<textarea class="form-control" th:id="description"></textarea>
</div>
<div class="form-group">
<label for="message-text" class="col-form-label">Autre personne:</label>
<textarea class="form-control" th:id="autrePersonne"></textarea>
</div>
<div class="form-group bout">
<a id='aze' th:href="@{/valider(id=${id})}" class="btn btn-primary b" >Valider</a> <input type="button" class="btn btn-primary" value="Rejeter"/>
</div>
</form>
</div>
</body>
</html> |
Si quelqu'un à une idée
Merci.