I have a page that has employee info, such as their address. I want the user to be able to enter in US zip + 4 using the WebMaskEdit (Zip Code), but they also need to be able to enter foreign postal codes, which need to have alpha characters, such as Canada (i.e. L7J 1K3). The country dropdown will be blank if the address is US and something will be selected if it's a foreign address. Is there a way to switch the mask from WebMaskEdit (Zip Codes) to WebTextEdit (allowing alpha-numeric) during runtime depending on whether the user has selected a country?
Hi,
Changing control from mask to no-mask is not supported. Also changing mask on client is not supported neither (you will get problem on server with interpretation value).
However, since WebTextEdit allows dynamic filtering it is quite simple to turn it into any filter. For example, process ClientSideEvents.KeyDown and implement it by something like below
// assume that is your setter mask/noMask functionfunction myDynamicMaskSet(enable){ var edit = igedit_getById('WebTextEdit1'); if(!edit) { alert('can not find WebTextEdit1'); return; } if(enable) { edit.elem.maxlength = 5; edit._onlyDigits = true; } else { edit.elem.maxlength = 8; edit._onlyDigits = false; }}