Skip to content
Snippets Groups Projects
Commit fddb3858 authored by Andie Hunt's avatar Andie Hunt
Browse files

Store and reinstate valid state/county when copying

parent c5e02dc5
Branches
Tags
No related merge requests found
......@@ -43,7 +43,21 @@
callbackURL = {/literal}"{crmURL p='civicrm/ajax/jqState' h=0}"{literal}
cj( '#' + countryID ).chainSelect( '#' + stateProvinceID, callbackURL, null );
cj( '#' + countryID ).chainSelect(
'#' + stateProvinceID,
callbackURL,
{
before : function (target) {
if (typeof(setdefault) === "undefined") { setdefault = new Array(); }
targetid = cj(target).attr("id");
eval('setdefault[targetid] = cj(target).val()');
},
after : function(target) {
targetid = cj(target).attr("id");
cj(target).val(setdefault[targetid]);
}
}
);
});
{/literal}
{/if}
......@@ -63,7 +77,19 @@
callbackURL = {/literal}"{crmURL p='civicrm/ajax/jqCounty' h=0}"{literal}
cj( '#' + stateProvinceID ).chainSelect( '#' + countyID, callbackURL, null );
cj( '#' + stateProvinceID ).chainSelect( '#' + countyID, callbackURL,
{
before : function (target) {
if (typeof(setdefault) === "undefined") { setdefault = new Array(); }
targetid = cj(target).attr("id");
eval('setdefault[targetid] = cj(target).val()');
},
after : function(target) {
targetid = cj(target).attr("id");
cj(target).val(setdefault[targetid]);
}
}
);
});
{/literal}
{/if}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment