Below is a simple solution, which is also based on JavaScript.
<script type="text/javascript">
function clearDropDown(LookupFieldTitle)
{
if(getField('select',LookupFieldTitle))
{
//if lookup has 19 or less items - SELECT
theDropDown = getField('select',LookupFieldTitle);
theDropDown.options.length = 0;
var opt = document.createElement("option");
opt.text = '(None)';
opt.value = '';
theDropDown.add(opt);
}
else
{
theDropDown = getField('input',LookupFieldTitle);
theDropDown.choices = '(None)|0';
}
}
var ccd3 = new cascadeDropdowns('Category', 'Sub Category', 'refCategory', 'refSubCategory', 'Title');
clearDropDown('Sub Category');
</script>
The function cascadeDropdowns() and getField() come from spcd.js.
THank You.... Its working!!!
ReplyDelete