Hello,
We have a zip code entry text box that utilizes radmasktextbox to require entry of zipcode in us format. We'd like to support international postal code standards. I have created some JavaScript that in theory should switch the text box on client side to allow up to 10 of any characters when the nation isn't USA, but its simply not totally changing the text entry formatting. It can get to the point where it prints your characters in the box when you type, but when you blur it will strip out any chars that violate the old rules (US, 5+4).
Not permitting changing of the mask in clientside easily seems to be a fantastically big oversite. how does one do this?
code to change the mask:
funciton changeFormat(sender, args) { var unitedStates = ['US', 'USA', 'UNITED STATES', 'UNITED STATES OF AMERICA']; var i = 0; var mask = []; if (unitedStates.indexOf($find(countryControlId).get_value().toUpperCase()) < 0) { for (i = 0; i < 10; i++) { mask[mask.length] = new Telerik.Web.UI.RadFreeMaskPart(); } } else { for (i = 0; i < 5; i++) { mask[mask.length] = new Telerik.Web.UI.RadDigitMaskPart(); } mask[mask.length] = new Telerik.Web.UI.RadLiteralMaskPart('-'); for (i = 0; i < 4; i++) { mask[mask.length] = new Telerik.Web.UI.RadDigitMaskPart(); } } $find(zipControlId).set__initialDisplayMasks(mask); $find(zipControlId).set__initialMasks(mask); $find(zipControlId)._setDisplayMask(mask); $find(zipControlId)._setMask(mask); $find(zipControlId)._length = 0; $find(zipControlId).clear(); }