ITFR Posted June 5, 2015 Share Posted June 5, 2015 (edited) Bonjour, Savez-vous comment masquer l'ajout de fichier (fileupload) sur le formulaire de contact en fonction de l'id contact sélectionné dans le dropdown menu ? js ? Cordialement, Vincent Edited June 15, 2015 by ITFR (see edit history) Link to comment Share on other sites More sharing options...
ITFR Posted June 17, 2015 Author Share Posted June 17, 2015 Je réponds pour les personnes intéressées: <script>$(document).ready(function(){ $("div#fileup").hide() $("select#id_contact").change(function(){ if ($("select#id_contact option:selected").val() == "3"){ $("div#fileup").show(); }else if ($("select#id_contact option:selected").val() !== "3"){ $("div#fileup").hide(); }else{ $("div#fileup").hide(); } });}); </script> {if $fileupload == 1} <div class="form-group" id="fileup"> <label for="fileUpload">{l s='Attach File'}</label> <input type="hidden" name="MAX_FILE_SIZE" value="2000000" /> <input type="file" name="fileUpload" id="fileUpload" class="form-control" /> </div> {/if} A+ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now