Hello @mpmarinov
I’m sorry, but I don’t understand your question. What do you mean with search in form?
Best regards.
Hello @codepeople,
I have 100 checkboxes or 100 items in a dropdown list.
How can I make a search field and select the search items, etc?
Hello @mpmarinov
You need to integrate external libraries with the form. It applies to the DropDown fields.
Please, insert an “HTML Content” field in the form with the following piece of code as its content:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.min.css" integrity="sha256-EH/CzgoJbNED+gZgymswsIOrM9XhIbdSJ6Hwro09WE4=" crossorigin="anonymous" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/chosen/1.8.7/chosen.jquery.min.js"></script>
<script>
jQuery(window).on('load', function(){
jQuery('.cff-dropdown-field select').chosen();
});
</script>
And that’s all.
Best regards.
And can this be done with a checkbox?
Hello @mpmarinov
No, I’m sorry, the Chosen library (we are not the developers of this library) can be used only with the DropDown fields.
Best regards.
Hello codepeople,
in my website the above code does not work on Chrome, Opera and mobile phone.
Do you know why that is and what can be done?
Thanks!
Hello @mpmarinov
Yes, you are right, the Chosen library does not have support for mobiles. The alternative here would be to replace the Chosen library with Select2.
Please, replace the code into the “HTML Content” field with the following one:
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>
<script>
jQuery(window).on('load', function(){
jQuery('.cff-dropdown-field select').select2();
});
</script>
Best regards.
Unfortunately it doesn’t change. The same remains: under Opera and Chrome there is no search field. It only works on Edge Browser. I don’t know if there are opportunities for others …
Would be very grateful if you can help me further.
Best regards!
Hello @mpmarinov
Please, indicate the URL to the page where the form is inserted to check it in action.
Best regards.