Forums
Forums / Plugin: WC Fields Factory / Not show fields if empty
(@webbieworks)
7 years, 5 months ago
Is there anyway to not show fields if the data is not filled in? Example, I have Model, Serial, Color. If only Model and Serial have the info, how do I get the Color not to show on the frontend?
(@sarkparanjothi)
Hi @webbieworks,
i guess you are using admin field. `<script> var $ = jQuery; $(document).ready(function(){ var wcff_fields = $( “.wccpf-field” );
for( var i = 0; i < wcff_fields.length; i++ ){ if( $( wcff_fields[i] ).val().trim() == “” ){ $( wcff_fields[i] .closest( “.wccpf_fields_table” ).remove() } }
}); <script>`
add this line into your theme fooder.php
If you have any other doubt plase let me know.
Thanks
The topic ‘Not show fields if empty’ is closed to new replies.