回答

-1

試試這個代碼

<%@ language="C#" %> 
    <form id="form1" runat="server"> 
     <asp:TextBox ID="txtName" runat="server"/> 
     <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> 
     <asp:RegularExpressionValidator ID="regexpName" runat="server"  
             ErrorMessage="This expression does not validate." 
             ControlToValidate="txtName"  
             ValidationExpression="^[a-zA-Z'.\s]{1,40}$" /> 
    </form> 
+1

-1:什麼有這個做與SharePoint形式? – Stefan 2012-01-19 08:32:01

0

JQuery的救援,我再次想到過:我用這個這個類型,我想限制輸入值的形式進入:

$('input[title="MyColumnName"]').keyup(function() { 
     this.value = this.value.replace(/[^a-zA-Z]/g, ''); 
    });