Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
WebMaskEditor give focus to part of mask
posted

I have a web mask editor with an Input Mask set as "0000->00000000" in order to display a field with a year component, a dash, followed by a 8 digit number, such as "2013-00000001" (YYYY-NNNNNNNN).

<ig:WebMaskEditor ID="YearAndNumberControl" runat="server" Width="100%" Height="16px" DisplayMode="Mask" InputMask="0000->00000000">

This mask ensures that data can only be entered if it adheres to the YYYY-NNNNNNNN format. However, I am setting the text of this editor as the current year on page load (attempted to pre-populate the year component of the mask). When a user tabs into this control, I would like to highlight the NNNNNNNN component of the mask instead of the entire control. I have tried the various SelectionOnFocus options and have not been able to produce the desired result. Is there any way I can get the desired effect with this control?

Parents
  • 45
    posted

    The bottom portion of my post got formatted oddly, it read:

    This mask ensures that data can only be entered if it adheres to the YYYY-NNNNNNNN format. However, I am setting the text of this editor as the current year on page load (attempted to pre-populate the year component of the mask). When a user tabs into this control, I would like to highlight the NNNNNNNN component of the mask instead of the entire control. I have tried the various SelectionOnFocus options and have not been able to produce the desired result. Is there any way I can get the desired effect with this control?

     

Reply Children
No Data