Skip to content
Snippets Groups Projects
Commit 0ee78407 authored by nicrausaz's avatar nicrausaz
Browse files

clear script, comments

parent ef8c46d6
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,7 @@
</select>
</div>
<!-- / Choix formation -->
<div id="all" style="display: none;"> <!-- hide it -->
<div id="all" style="display: none;">
<div class="form-group">
<!-- Infos filières informaticien -->
<div id="infoOnly">
......@@ -215,6 +215,7 @@
<hr>
<!-- Activités pro -->
<h3>3. Activités</h3>
<!-- Scolarité -->
<h5>3.1 Scolarité</h5>
<table id="scolaire">
<tr>
......@@ -260,6 +261,8 @@
<input type="text" name="anneeFin" id="anneeFin" class="form-control" placeholder="Année de fin de scolarité" value="<?php echo $_SESSION['postedForm']['anneeFin'] != '' ? $_SESSION['postedForm']['anneeFin'] : ''; ?>" maxlength="4" data-required/>
<small id="anneeFinError" class="error form-text text-muted"></small>
</div>
<!-- / Scolarité -->
<!-- Formations -->
<h5>3.2 Activités professionnelles</h5>
<small>Formations / apprentissages après la scolarité.</small>
......@@ -295,6 +298,8 @@
<?php }} ?>
</table>
<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addPro">Ajouter une ligne</button>
<!-- / Formations -->
<!-- Stages -->
<h5 class="mt-3">3.3 Stages</h5>
<table id="stages">
<tr>
......@@ -339,13 +344,15 @@
<input type="text" name="dejaCandAnnee" id="dejaCandAnneeInput" class="form-control" placeholder="Année de candidature" value="<?php echo $_SESSION['postedForm']['dejaCandAnnee'] != '' ? $_SESSION['postedForm']['dejaCandAnnee'] : ''; ?>" maxlength="4"/>
<small id="dejaCandError" class="form-text text-muted error"></small>
</div>
<!-- / Stages -->
<!-- / Activités pro -->
<hr>
<!-- Annexes -->
<h3>4. Annexes</h3>
<small>Merci de joindre tous les fichiers demandés, en respectant les formats (si les formats ne sont pas respectés, les fichiers ne seront pas pris en compte).</small>
<br>
<small>Formats autorisés: <b>PDF, JPG, JPEG, PNG</b></small>
<!-- Annexes obligatoires -->
<div class="form-group mt-3" id="files">
<div class="form-group">
<label for="photo">Photo passeport <strong>couleur: *</strong></label>
......@@ -390,7 +397,8 @@
<br>
<small class="error" class="form-text text-muted"></small>
</div>
<!-- / Annexes obligatoires -->
<!-- Annexes spécifiques -->
<div class="form-group" id="polyOnly">
<label for="gimch">Attestation de tests d'aptitudes GIM-CH (polymécanicien):</label>
<input type="file" name="gimch" class="upload-input" id="gimch" onchange="changeTitleFile(this)"/>
......@@ -412,8 +420,8 @@
<br>
<small class="error" class="form-text text-muted"></small>
</div>
<!-- / Annexes spécifiques -->
<!-- Annexes supplémentaires -->
<div class="form-group">
<table id="newCertifZone">
<tr>
......@@ -431,8 +439,9 @@
</table>
</div>
<button type="button" class="btn btn-primary btn-sm mt-3 mb-2" id="addInputFile">Ajouter une annexe</button>
<!-- / Annexes supplémentaires -->
</div>
<!-- / Annexes -->
<div class="form-group">
<div class="custom-control custom-checkbox" id="condDiv">
<input type="checkbox" class="custom-control-input" value="conditionsAcc" id="conditions" data-required/>
......@@ -450,7 +459,7 @@
if ($_SESSION['formError']) {
echo "<script>showOnFormReturn(lieu);</script>";
}
// require_once('templates/footer.php');
// require_once('templates/footer.php'); (debug du $_POST)
?>
</body>
</html>
\ No newline at end of file
......@@ -7,7 +7,6 @@ $(document).ready(function () {
initAddRadioButtonEvent();
initDateChecker();
initDatepicker();
// clearFiles();
checkRequired();
}
});
......@@ -64,7 +63,6 @@ function checkFileFormat(obj) {
if (allowedExtensions.indexOf(fileExtension) == -1) {
// extension invalide
errorZone.innerHTML = 'Format invalide'
clearFileInput(obj);
} else {
// extension valide
errorZone.innerHTML = '';
......@@ -236,24 +234,6 @@ function showPolyAndInfoDivs(selectedFormation) {
selectedFormation == "polyMecanicien" ? $("#polyOnly").show(1000) : $("#polyOnly").hide(500);
}
}
function clearFileInput(fileInput) {
$(fileInput).wrap('<form>').closest('form').get(0).reset();
$(fileInput).unwrap();
}
function clearFileLabel(fileInputLabel) {
$(fileInputLabel)[0].title = "Aucun fichier choisi";
}
function clearFiles() {
$("#files input").each(function (input) {
clearFileInput(this);
});
$("#files label").each(function (input) {
clearFileLabel(this);
});
}
function checkRequired() {
$("form").submit(function (e) {
......
......@@ -12,7 +12,7 @@
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="./script.js"></script>
<style>.error { color: red!important; }</style>
<noscript>Veuillez Activer JavaScript pour utiliser le service de postulation</noscript>
<noscript>Veuillez Activer JavaScript pour utiliser le service de postulation !</noscript>
<?php
ini_set("display_errors", 0);
error_reporting(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment