PageSourceSearch

https://www.bustpn.ch/data/Themes/tpn19/js/formControl.js

js bustpn.ch collected 2026-09-24 20:18:14 UTC 1,778 bytes, 67 lines download raw bytes

1// Fonction qui vérifie que les champs de formulaire obligatoires soient complétés
2
3$(".formControl").on('submit',formControl);
4function formControl()
5{
6  var notError = true;
7
8  jQuery('.has-feedback').each(function(){
9
10    jQuery(this).removeClass('has-error');
11    jQuery("i", this).removeClass('fas fa-times');
12
13    if(jQuery(".form-control", this).val()=="")  {
14      jQuery(this).addClass('has-error');
15      jQuery("input", this).focus();
16      jQuery("i", this).addClass('fas fa-times');
17      notError = false;
18    }
19    else {
20      jQuery(this).addClass('has-success');
21      jQuery("i", this).addClass('fas fa-check');
22    }
23
24  });
25  
26  jQuery("#_DF_strEmailTo").val(jQuery("#email").val());
27  return notError;
28}
29
30$(".formControlServiceClientele").on('submit',formControlServiceClientele);
31function formControlServiceClientele()
32{
33  var notError = formControl.call(this);
34
35  if(notError)
36  {
37    if(jQuery("#type-demande").val() == "Réclamation")
38    {
39      jQuery("#commentaire").remove();
40    }
41    else
42    {
43      jQuery("#reclamation").remove();
44    }
45  }
46  
47  jQuery("#_DF_strEmailTo").val(jQuery("#email").val());
48  return notError;
49}
50
51$("#type-demande").on("change", function()
52{
53  if(jQuery(this).val() == "Réclamation")
54  {
55    jQuery("#commentaire").addClass("hidden");
56    jQuery("#commentaire>div.form-group.control").removeClass("has-feedback");
57    jQuery("#reclamation").removeClass("hidden");
58    jQuery("#reclamation>div.form-group.control").addClass("has-feedback");
59  }
60  else
61  {
62    jQuery("#reclamation").addClass("hidden");
63    jQuery("#reclamation>div.form-group.control").removeClass("has-feedback");
64    jQuery("#commentaire").removeClass("hidden");
65    jQuery("#commentaire>div.form-group.control").addClass("has-feedback");
66  }
67});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.