ben-g
2/23/2017 - 5:41 PM

jQuery for removing all programs that are NOT the ones listed.

jQuery for removing all programs that are NOT the ones listed.

//pre-select dropdown option

<script>// <![CDATA[
$(document).ready(function() { $('#item_id option:not([value="3651"], [value="3105"])').remove(); 
$('#item_id').val('3105');
});
// ]]></script></div>
</div>
// Values shown below are placeholders for the real ids.


$('#item_id option:not([value="1111"], [value="2222"])').remove()

// inside html

<script>// <![CDATA[
$(document).ready(function() { $('#item_id option:not([value="1111"], [value="2222"])').remove() });
// ]]></script></div>

//inside js custom field
$('#item_id option:not([value="1111"], [value="2222"])').remove() });