This is a migrated thread and some comments may be shown as answers.

RadMaskedTextBox Copy/Paste Issue in IE7

11 Answers 128 Views
Input
This is a migrated thread and some comments may be shown as answers.
jai
Top achievements
Rank 1
jai asked on 23 May 2008, 08:57 AM
Hi

Im using RadMaskedTextBox for phone input in my project, in that im facing issue like copy/paste is not working with IE browser and its fine Mozilla. Need to add any additional stuff to overcome this? help me to solve this problem.

<telerik:RadMaskedTextBox ID="txtOrgFax" Mask="(###) ###-####" PromptChar=" " runat="server">                                       </telerik:RadMaskedTextBox>

looking for ur response

Regards
Jai.

11 Answers, 1 is accepted

Sort by
0
Cedric
Top achievements
Rank 2
answered on 02 Jun 2008, 08:59 PM
I have the same problem, but no one seem to respond....


I've the same problem with the telerik demo, the RadMaskedTextBox do not allow me to paste contain in the field.

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Input/Examples/Common/CopyPaste/DefaultCS.aspx
0
Yavor
Telerik team
answered on 03 Jun 2008, 05:32 AM
Hi Cedric,

I believe the issue has been fixed in the latest version of the control. You can upgrade to the latest version, to take care of the issue.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Cedric
Top achievements
Rank 2
answered on 03 Jun 2008, 02:22 PM
I use the last version and it do not work properly. Test it by your own, add this to a page:

<

telerik:RadMaskedTextBox runat="server" ID="RadTest" Mask="aaaaa-aaaaa" />

and with IE7 try to paste this code : EJ4L7-N3LH7

nothing happen but if you try it in firefox, it will work....

0
Pavel
Telerik team
answered on 04 Jun 2008, 08:32 AM
Hi Cedric,

Unfortunately you are right and this is a bug with our MaskedTextBox under IE. I have notified our developers and hopefully they will fix it for the next release of the controls. Please excuse us for this temporary inconvenience.

Greetings,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Troy
Top achievements
Rank 1
answered on 23 Jul 2008, 07:01 PM
telerick,

I believe I am now dealing with a situation similar that described in this thread, and I am wondering if this bug has been resolved yet? If so, I will update to the most recent version.

In case it is important, I will also describe my problem. If you feel my problem is not close enough related to the topic of this thread, I will happily start a new thread for this situation.

I am using a RadMaskedTextBox and am applying an international phone number mask to it: 

"#### (####) ############ ext. #####"

This mask is working great, and the values are being stored into the database correctly.

However, we are also giving the user the option of editing this phone number, and we are also applying this mask to the edit template. Thus, both the edit and standard templates produce phone number fields that look like:

"____ (____) ____________ ext. _____" 

The problem we are facing is, if the user does not enter any numbers at all in the first portion of the mask, before the parenthesis, like this for example:

"____ (1___) ____________ ext. _____" 

...in this case, the value of "(1) ext. " is stored in the database, which is fine, but then, if the user goes to edit the phone number field the "(1) ext. " is being applied again to the mask before it is displayed in the edit template, and the result is an empty field that looks like nothing had ever been entered into it, like this:

"____ (____) ____________ ext. _____" 

...My guess is that this is happening because "(1) ext. " does not match up will with the mask with the parenthesis being the first character in the string, but with the mask expecting a number as the first character.

So, if I described this scenario well enough for it to be understood, is there anything else I can do to address this, or is it part of the bug mentioned above? If it is part of the bug, has it been addressed yet? 
0
Troy
Top achievements
Rank 1
answered on 23 Jul 2008, 10:14 PM
In case this is helpful for anyone else, I resolved the above described problem with the following code:

private string EnforcePhoneNumberMask(string strMask, string strStringToMask)  
{  
    // We had a problem in which the mask was not working with a mask of "#### (####) ############ ext. #####"  
    // The problem was, if the first 4 characters to the left of first paren (indicated with a # in the mask)   
    // were not populated while the number field was being edited. In order to resolve this, we are forced to   
    // right-pad all empty spaces with underscores.  
 
    bool blnNumericTest;  
    int i, diff, intNumericTest;  
 
    string strCharToTryParse, tempStringValue = strStringToMask;  
 
    int nPoundIndex = strMask.IndexOf("#");  
    while ((nPoundIndex != -1))  
    {  
        if (nPoundIndex > (tempStringValue.Length - 1))  
        {  
            diff = (strMask.Length - tempStringValue.Length);  
 
            for (i = 0; i < diff; i++)  
            {  
                tempStringValuetempStringValue = tempStringValue.Insert(nPoundIndex, "_");  
            }  
        }  
        else  
        {  
            strCharToTryParse = tempStringValue.Substring(nPoundIndex, 1);  
 
            blnNumericTest = int.TryParse(strCharToTryParse, out intNumericTest);  
 
            if (!blnNumericTest)  
            {  
                tempStringValuetempStringValue = tempStringValue.Insert(nPoundIndex, "_");  
            }  
        }  
 
        nPoundIndex = strMask.IndexOf("#", nPoundIndex + 1);  
    }  
 
    return tempStringValue;  

0
Troy
Top achievements
Rank 1
answered on 23 Jul 2008, 10:50 PM
Small update to the code I posted previously...

private string EnforcePhoneNumberMask(string strMask, string strStringToMask)  
{  
    // We had a problem in which the mask was not working with a mask of "#### (####) ############ ext. #####"  
    // The problem was, if the first 4 characters to the left of first paren (indicated with a # in the mask)   
    // were not populated while the number field was being edited. In order to resolve this, we are forced to   
    // right-pad all empty spaces with underscores.  
 
    bool blnNumericTest;  
    int i, diff, intNumericTest;  
 
    string strCharToTryParse, tempStringValue = strStringToMask;  
 
    int nPoundIndex = strMask.IndexOf("#");  
    while ((nPoundIndex != -1))  
    {  
        if (nPoundIndex > (tempStringValue.Length - 1))  
        {  
            diff = (strMask.Length - tempStringValue.Length);  
 
            for (i = 0; i < diff; i++)  
            {  
                tempStringValuetempStringValue = tempStringValue.Insert(nPoundIndex, "_");  
            }  
 
            return tempStringValue;  
        }  
        else  
        {  
            strCharToTryParse = tempStringValue.Substring(nPoundIndex, 1);  
 
            blnNumericTest = int.TryParse(strCharToTryParse, out intNumericTest);  
 
            if (!blnNumericTest)  
            {  
                tempStringValuetempStringValue = tempStringValue.Insert(nPoundIndex, "_");  
            }  
        }  
 
        nPoundIndex = strMask.IndexOf("#", nPoundIndex + 1);  
    }  
 
    return tempStringValue;  
0
Nitin
Top achievements
Rank 1
answered on 18 Oct 2012, 07:19 AM
Hi,
I can still see this problem, Just to ask Telerik Team have you fixed this issue in any version?
0
Vasil
Telerik team
answered on 18 Oct 2012, 11:39 AM
Hi Nitin,

I just tested it with the latest version and it is working correctly on my end.

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Nitin
Top achievements
Rank 1
answered on 18 Oct 2012, 12:43 PM
Hi,
I am using IE9, and when I press Control+X to cut and Control+V to paste it is working fine but when I click on the control and do mouse right click and do cut and paste it is not working.

I tested this is your Demo website:

http://demos.telerik.com/aspnet-ajax/input/examples/radmaskedtextbox/firstlook/defaultcs.aspx
0
Vasil
Telerik team
answered on 18 Oct 2012, 12:59 PM
Hello Nitin,

I see the issue, it happens only when cutting and pasting to the same input without bluing it. We will investigate it further.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
jai
Top achievements
Rank 1
Answers by
Cedric
Top achievements
Rank 2
Yavor
Telerik team
Pavel
Telerik team
Troy
Top achievements
Rank 1
Nitin
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or