add options in Lookup field after filtering

By: Andreas panagiotopoulos | Asked: 12/09/2024
ForumsCategory: Code Snippetsadd options in Lookup field after filtering
Andreas panagiotopoulos asked 5 days ago
I use lookup fields in one of the forms, I have set the option 'Filter by Lookup Fields', values are filtered based on the previous choice and everything is ok. I'd like now to extend this option. Instead of filtering values based on the previous choice, I'd like the following: -- show extra possible values of the field ignoring the choice made in the previous field -- autoselect values that should have been filtered regarding the choice of previous field Please check the attached screenshot. When user chooses unit 'Trends And Concepts', then next field shows only Competences of that unit. I have set this functionality with lookup fields as I said before. I'd like the next field to show all values (all competences) but autoselect (with checkbox) only the first competences that belongs to the selected unit. I have used this javascript https://formidableforms.com/knowledgebase/javascript-examples/#kb-check-all-options-in-lookup-field to autoselect the filtered values. And I have written a php snippet to add more choices to the checkbox field (and only the filtered ones based on the previous field). The point is now that php snippet runs first, so both filtered and extra choices are auto-selected with the javascript. How can I manage to auto select only filtered values (with javascript) and then extend the available choises with no auto-select option? Thank you!
Attachments
Andreas panagiotopoulos replied 15 hours ago

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right