Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,



Is it possible to mask a text field in sharepoint 2010.
I have phone number field, i want this to masked in following format.
Phone mask: (###) ###-###


Can anyone help!

Thanks
Posted

Got the solution:

XML
<script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript" ></script>
<script language="javascript" src="http://jquery-joshbush.googlecode.com/files/jquery.maskedinput-1.2.2.min.js" type="text/javascript" ></script>
<script language="javascript" type="text/javascript">

jQuery(function($){
   $("input[title='Number']").mask("(999) 999-9999",{placeholder:"#"}).val("(###) ###-####");
});

</script>




Here "Number" is the field name.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900