Minor changes

This commit is contained in:
Chaïb Martinez 2019-02-14 12:11:28 +01:00 committed by Paul Chavard
parent 7124965ba8
commit e9c4ff41a7

View file

@ -20,23 +20,10 @@
= label_tag :type do = label_tag :type do
Votre problème Votre problème
%span.mandatory * %span.mandatory *
= select_tag :type, options_for_select(@options, params[:type]),include_blank:"Choisir un problème", onchange:"show()" = select_tag :type, options_for_select(@options, params[:type]),include_blank:"Choisir un problème",onchange:"show()", required: true
#info_demarche.contact-champ.aidesupport.hide #aidesupport
Mon texte info_demarche
%br
%br
#usager_perdu.contact-champ.aidesupport.hide
Mon texte usager_perdu
%br
%br
#info_instruction.contact-champ.aidesupport.hide
Mon texte info_instruction
%br
%br
.contact-champ .contact-champ
@ -65,6 +52,7 @@
= button_tag 'Envoyer le message', type: :submit, class: 'button send primary' = button_tag 'Envoyer le message', type: :submit, class: 'button send primary'
:javascript :javascript
function show(){ function show(){
var e = document.getElementById ("type"); var e = document.getElementById ("type");
var choix = e.options [e.selectedIndex] .value; var choix = e.options [e.selectedIndex] .value;
@ -73,29 +61,26 @@
var div_usager_perdu_ = document.getElementById("usager_perdu"); var div_usager_perdu_ = document.getElementById("usager_perdu");
var div_info_instruction = document.getElementById("info_instruction"); var div_info_instruction = document.getElementById("info_instruction");
console.log(divid);
switch (divid) { switch (divid) {
case 'info_demarche': case 'info_demarche':
console.log('info_demarche'); console.log('info_demarche');
document.getElementById("info_demarche").classList.add("show"); document.getElementById("aidesupport").innerHTML = "aaaaa";
break; break;
case 'usager_perdu': case 'usager_perdu':
console.log('usager_perdu'); console.log('usager_perdu');
document.getElementById("usager_perdu").classList.add("show"); document.getElementById("aidesupport").innerHTML = "bbbbb";
break; break;
case 'info_instruction': case 'info_instruction':
console.log('info_instruction'); console.log('info_instruction');
document.getElementById("info_instruction").classList.add("show"); document.getElementById("aidesupport").innerHTML = "cccc";
break; break;
default: default:
console.log('defaut'); console.log('defaut');
document.getElementById("aidesupport").innerHTML = "";
} }