Sharepoint:Sharepoint自定义列表验证

时间:2012-01-18 17:07:42

标签: sharepoint sharepoint-2010 sharepoint-2007 sharepoint-designer

有人可以告诉我如何为SharePoint列表中的“单行文本”字段编写验证公式,它只接受字符。

3 个答案:

答案 0 :(得分:3)

我认为没有SP Designer,这是不可能的。有以下功能: ISBLANK ISERR ISERR ISLOGICAL ISNA ISNONTEXT ISNULL ISNUMBER ISTEXT 看到这个参考: http://office.microsoft.com/en-us/sharepoint-foundation-help/is-functions-HA100405908.aspx

答案 1 :(得分:0)

再次拯救JQuery我曾经想过:我在形式中使用这种类型的条目来限制输入值:

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

答案 2 :(得分:-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>