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
40
WebMaskEdit
posted

I need to define a alpha only edit mask for a field with a length of 30 characters.   Is there a simple method of npot having to type out 30 question marks?

Thanks for any suggestions!  

 

Parents
  • 24497
    posted

    Hi,

    If you need entry without prompts, then you should use WebTextEdit. Idea behind WebMaskEdit is provide strict length of entry.

    It is very easy to filter entry. Example of editor which has max length of 30 and allows only A-Z and a-z entries:

    <script type="text/javascript">
    function WebTextEdit1_KeyPress(oEdit, keyCode, oEvent)
    {
     //------------------
     
    // cancel all characters which are smaller than A and larger than z
     
    // A==65, z==122
     
    if(keyCode < 65 || keyCode > 122)
     
    oEvent.cancel = true;
     
    //------------------
     
    // cancel all characters which are between Z and a
     
    // Z==90, a==97
     
    if(keyCode > 90 && keyCode < 97)
     
    oEvent.cancel = true;
    }
    </script>
    <igtxt:WebTextEdit ID="WebTextEdit1" runat="server" MaxLength="30">
     
    <ClientSideEvents KeyPress="WebTextEdit1_KeyPress" />
    </igtxt:WebTextEdit>

Reply Children