Commit 804c5ee
Changed files (2)
js/trax_input.js
@@ -9,10 +9,7 @@ $(document).ready( function() {
type: form.method,
data: $(form).serialize(),
success: function (response) {
- $('#submitAlert').empty();
- $('#submitAlert').append(response);
- $('#submitAlert').addClass('alert-success');
- $('#submitAlert').show();
+ bootstrap_alert.success(response);
}
});
},
@@ -26,3 +23,13 @@ $(document).ready( function() {
debug:true,
});
})
+
+bootstrap_alert = function () {}
+bootstrap_alert.success = function (message) {
+ $('alert_placeholder').html(
+ '<div id="alert" class="text-center alert alert-dismissable col-sm-8 col-sm-offset-2">'+
+ message +
+ '<button type="button" class="close" aria-hidden="true" data-dismiss="alert" >×</button>'+
+ '</div>'
+ {
+}
input.php
@@ -1,8 +1,7 @@
<?php include 'header.php' ?>
<div class="container">
<div class="row">
- <div id="submitAlert" class="text-center alert alert-dismissable col-sm-8 col-sm-offset-2" style="display:none;">
- <button type="button" class="close" aria-hidden="true" >×</button>
+ <div id="alert_placeholder" class="text-center alert alert-dismissable col-sm-8 col-sm-offset-2" style="display:none;">
</div>
<form class="form-horizontal col-sm-8 col-sm-offset-2" role="form"
method="POST" action="input_process.php" id="carForm">