Not sure what you exactly you meant, if you need to update the script
to work with JQuery 1.3, TuxX posted a solution on the site.

Changing the original line:
$("#"+child+' opti...@value="'+ childVal +'"]').attr
('selected','selected');
to
$(”#”+child).val(["'+ childVal +'"]).attr(’selected’,’selected’);

See complete revised version below

function makeSublist(parent,child,isSubselectOptional,childVal)
{
$(”body”).append(”");
$(’#'+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(” ― Select ― “);
$(’#'+child).trigger(”change”);
$(’#'+child).focus();
}
);
} $(document).ready(function()
{
makeSublist(’child’,'grandsun’, true, ”);
makeSublist(’parent’,'child’, false, ‘1′);
});

HTH

Reply via email to