asked on August 30, 2018
Hi all,
In my Web Form, I have an input with auto-suggestions.
I want to see the suggestions only if the field.lenght > 0.
I tried to create the rule using Javascript.
$(document).ready(function () { //On affiche les suggestions seulement si on a écrit $(".awesomplete-child").hide(); $( "#q72 input" ).keyup(function() { var n = $( "#q72 input" ).val() ; var n = n.length ; if (n > 0) { //alert("ok"); $(".awesomplete-child").show(); } else { $(".awesomplete-child").hide(); } }); })
It works but not properly.
This function $(".awesomplete-child").hide(); (line 3) doesn't work.
When I'm clicking for the first time in my field, I have the suggestions.
How can I hide this suggestions at the begining ?
Thanks in advance.
Regards
0
0