it is quite easy to enable the canada post autocomplete, we just need to follow the sample from Canada post autocomplete.
here is the sample code to initialize the Canada post autocomplete to a textbox with id "street-address"
enableCanadaPostAutoComplete = function () {
var fields = [
{
element: "street-address", field: "Line1"
},
{
element: "street-address2", field: "Line2",
},
{
element: "city", field: "City", mode: pca.fieldMode.PRESERVE
},
{
element: "province", field: "ProvinceCode", mode: pca.fieldMode.POPULATE
},
{
element: "postal", field: "PostalCode", mode: pca.fieldMode.PRESERVE
},
{ element: "country", field: "CountryIso3", mode: pca.fieldMode.COUNTRY }
],
options = {
key: sci.CanadaPostKey,
};
control= new pca.Address(fields, options);
}
if you want to remove the Canada post autocomplete feature from the input textbox, then i will show how make it work around
var canadaPostAutoCompleteControl = canadaPostAutoCompleteControl || {};
enableCanadaPostAutoComplete = function () {
var fields = [
{
element: "street-address", field: "Line1"
},
{
element: "street-address2", field: "Line2",
},
{
element: "city", field: "City", mode: pca.fieldMode.PRESERVE
},
{
element: "province", field: "ProvinceCode", mode: pca.fieldMode.POPULATE
},
{
element: "postal", field: "PostalCode", mode: pca.fieldMode.PRESERVE
},
{ element: "country", field: "CountryIso3", mode: pca.fieldMode.COUNTRY }
],
options = {
key: myCanadaPostKey,
};
canadaPostAutoCompleteControl = new pca.Address(fields, options);
}
disableCanadaPostAutoComplete = function () {
if (canadaPostAutoCompleteControl) {
canadaPostAutoCompleteControl.destroy();
}
}
you can call disableCanadaPostAutoComplete in the click event.
a blog to share Microsoft technologies Azure, DotNet, SharePoint, SQL Server,JavaScript Framework: Node.JS, Angular, React
Monday, March 5, 2018
Friday, March 2, 2018
How to fix "Could not load file or assembly or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" error in web publish deployment in Windows 8?
I had to make a deployment on the new branch which was branching from the original project. it is working fine that i published the web to the server in the original branch. However i encountered an error
"SGEN : error : Could not load file or assembly 'file:///C:\Users\ddeng\Documents\\bin\HiQPdf.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
When i check the folder, the HiQPdf.dll file did exist in the folder. the root cause of this error is that those third party DLL had been locked by Windows 8 due to security concern.
we have to unlock it to allow the publish action to move the dll to the destination folder.
please follow the steps to fix the issue.
1. right click to get properties
2 in the properties there was a button UNBLOCK, click on the Unlock button and applied the change.
try to rebuild again. you will see your publish go through suceessfully.
"SGEN : error : Could not load file or assembly 'file:///C:\Users\ddeng\Documents\\bin\HiQPdf.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)"
When i check the folder, the HiQPdf.dll file did exist in the folder. the root cause of this error is that those third party DLL had been locked by Windows 8 due to security concern.
we have to unlock it to allow the publish action to move the dll to the destination folder.
please follow the steps to fix the issue.
1. right click to get properties
2 in the properties there was a button UNBLOCK, click on the Unlock button and applied the change.
try to rebuild again. you will see your publish go through suceessfully.
Subscribe to:
Posts (Atom)