This is the code for the jQuery Plugin
/*
* jQuery Dynamic Dependant Select Lists
*/
function makeSublist(parent,child,isSubselectOptional,childVal){$("body").append("<select style='display:none' id='"+parent+child+"'></select>");$("#"+parent+child).html($("#"+child+" option"));var parentValue=$("#"+parent).attr("value");$("#"+child).html($("#"+parent+child+" .sub_"+parentValue).clone());childVal=(typeof childVal=="undefined")?"":childVal;$("#"+child).val(["'+ childVal +'"]).attr("selected","selected");$("#"+parent).change(function(){var parentValue=$("#"+parent).attr("value");$("#"+child).html($("#"+parent+child+" .sub_"+parentValue).clone());if(isSubselectOptional){$("#"+child).prepend("<option value='none'> -- Select -- </option>")}if($("#"+child+" option").length==0){$("#"+child).prepend("<option value=''> -- No Options Available -- </option>")}if($("#"+child+" option").length==1&&$("#"+child+" option").val()==""){$("#"+child).empty().prepend("<option value=''> -- No Options Available -- </option>")}$("#"+child).trigger("change");})};
you will obviously need to include jQuery itself as well.