Hello, I have a displayFormat pattern "$###,###,###;-$###,###,###;#"( it can be different too) and I want to reformat the value in the AspxTextbox after deleting the ',' on GotFocus and LostFocus events by calling the following JavaScript function :
function TextBoxFormat(ctrl, e, displayFormat, charactersToRemove) {
var value = ctrl.GetValue();
var i;
if (value != null && charactersToRemove != null) {
for (i = 0; i < charactersToRemove.length; i++)
value = value.replace(charactersToRemove[i], '');
ctrl.SetValue(ASPxFormatter.Format('{0:' + displayFormat + '}',
parseInt(value)));
}
I have tried to use ASPxFormatter but it is an internal class that is not indented to be used in a user project.Using String.Format('{0:' + displayFormat + '}', parseInt(value))); didn't work too , it threw an exception since String.format doesn't accept this format of pattern, Can you please provide a way to reformat my string to any pattern I want not only the one I recite since ? I highly appreciate your support....
Alaa
Thanks