Prevent Main category Posting
Hi Am using 3.0.5.2 version and I the
js code is not working provided in this forum..as it was for 3.0.4. can any one provide the update
JS for that. I was able to differentiate between codes of old and new version
Here is the Code from version 3.0.4
<?php
if (get_option('cp_price_scheme') == 'category' && get_option('cp_enable_paypal') == 'yes') {
cp_dropdown_categories_prices('show_option_none='. __('Select one','cp').'&class=dropdownlist&orderby=name&order =ASC&hide_empty=0&hierarchical=1
&exclude_tree='.CP_BLOG_CAT_ID);
} else {
wp_dropdown_categories('show_option_none='.__('Sel ect one','cp').'&class=dropdownlist&orderby=name&order =ASC&hide_empty=0&hierarchical=1
&exclude_tree='.CP_BLOG_CAT_ID);
}
?>
And This is version 3.0.5.2
<?php
if (get_option('cp_price_scheme') == 'category' && get_option('cp_enable_paypal') == 'yes') {
cp_dropdown_categories_prices('show_option_none='. __('Select one','appthemes').'&class=dropdownlist&orderby=nam e&order=ASC&hide_empty=0&hierarchical=1
&taxonomy=ad_cat');
} else {
wp_dropdown_categories('show_option_none='.__('Sel ect one','appthemes').'&class=dropdownlist&orderby=nam e&order=ASC&hide_empty=0&hierarchical=1
&taxonomy=ad_cat');
}
?>
JS available
<script type="text/javascript">
var dropdown = document.getElementById("cat");
function removeOptions(dropdown)
{
var i;
for(i=dropdown.options.length-1;i>=0;i--)
{
if(dropdown.options[i].className === 'level-0')
dropdown[i].disabled="disabled";
}
}
</script>
Clearly U can see the calling in the drop-down . Please any one provide the updated
Js code....
Last edited by jomarkosabel; December 2nd, 2010 at 08:20 AM.