Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inputmask for mmTextbox
Message
From
28/07/2010 12:49:19
 
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01473906
Message ID:
01474312
Views:
32
Eric,

that looks very helpful, thank you!

>Hi Frank,
>
>I put my references to jQuery in the master page, so it only has to be in one place instead of every ASPX page (though this may theoretically slow down each page load, I certainly don't notice it).
>
>
>    <script type='text/javascript' src='./js/jquery.js'/>
>    <script type='text/javascript' src='./js/jquery.cookie.js'/>
>    <script type="text/javascript" src="./js/date.js"/>
>    <script type='text/javascript' src='./js/json2.js'/>
>    <script type='text/javascript' src='./js/ui/ui.core.js'/>
>    <script type='text/javascript' src='./js/ui/ui.datepicker.js' />
>
>
>If you've specified a class you can use jQuery's selector functionality to apply the mask to all the elements on the page that use that class (or start with/end with a certain string, which is what I do for date fields so they automatically get a nice datepicker functionality). eg (still in the HEAD of the master page)
>
>     <script type="text/javascript">
>        $("document").ready()
>        {
>            $(".phone").mask("(999) 999-9999");  // Masks all element with the class='phone'
>        }
>     </script>
>
>
>Alternatively, and this works best if you put it on the specific ASPX page that has the control, you can specify by id
>
>     <script type="text/javascript">
>        $("document").ready()
>        {
>            $("#HomePhone").mask("(999) 999-9999");  // Masks the element with the id='HomePhone'
>        }
>    </script>
>
>
>Hope this helps,
>
>Eric
>
>
>>>Hi Frank,
>>>
>>>I use jQuery for this.
>>>
>>>See this page (http://nittrwave.typepad.com/blog/2010/04/jquery-masked-input-plugin.html) for examples. It's super easy.
>>>
>>>Eric
>>
>>Eric,
>>
>>it's not super easy for my tired brain. :(
>>
>>I have downloaded jsquery.js and put it in the same folder as my aspx pages. Now, where do I put the code:
>>
>>
<script type="text/javascript" src="jquery.js"></script>
>><script type="text/javascript" src="jquery.maskedinput.js"></script>
>>
>>Does this go in the codebehind file (aspx.cs) or the aspx page?
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform