ng-pattern

    1熱度

    2回答

    我的形式有以下在線驗證 <form name="coForm" novalidate> <div> <label>Transaction: </label> <input type="text" name="transaction" class="form-control" placeholder="<Direction> <Message Type>, ex.

    0熱度

    1回答

    對ng-pattern使用表單輸入指令。當ID爲表達式時,它在指令上的ID是一個字符串時會起作用(即顯示錯誤),但失敗(即從未顯示錯誤)。僞代碼: 工作 <form name="myForm" role="form" ng-submit="customer.submit()"> <form-input id="foo" ng-pattern="/^[0-9]+$/"></form-inp

    6熱度

    1回答

    請看看plunker。 http://plnkr.co/edit/DuTFYbLVbPkCIvRznYjG?p=preview ,其中n模式正則表達式是不會運用在輸入文本字段。 只要求驗證正確應用。 HTML: <body ng-controller="tableController"> <form name="test"> <div ng-repeat="model in

    1熱度

    1回答

    我想知道是否有一種簡單的方法可以在表單文本字段上設置此驗證,而無需創建自定義指示。 我需要驗證{minlength: 2, maxlength: 10},用戶可以輸入[A-Z0-9\s]的任意組合,但只有數量A-Z0-9將趨向最小和最大計數。 這可能嗎? 我在想也許使用ng-pattern和一些神奇的正則表達式可能會把它關閉。只需要一個錯誤消息觸發,如果ng-pattern未能通過匹配。

    1熱度

    2回答

    我使用正則表達式驗證電子郵件地址。我想測試的條件如下:在名稱,符號@最低的3 字符,最少3個字符的域名,一個點,第一部分不超過3個重複字符 我試着這個正則表達式,並且對於除了最後一個以外的所有情況都可以正常工作 /^[A-Za-z0-9._%+-]{3,}\@[A-Za-z0-9.-]{3,}\.[A-Za-z]{2,4}$/ 它不檢查點 不正常後重復字符(任何字符)(。):測試@測試。 cc

    1熱度

    2回答

    我需要在數字輸入字段內顯示00-09之間整數的前導零。我正在使用angularJS。 輸入字段(抱歉樣式的HTML內) 查看/模板: <script type="text/ng-template" id="form_field_time"> <h3 style="color:coral ;">{{field.displayName}}</h3> <div ng-controll

    0熱度

    1回答

    以下線路的正確方法是什麼? ng-pattern="(true)? apply-pattern : dont-apply-pattern" 我的問題是,我躲在ng-pattern領域的不需要的時候,但還是它不允許的形式是有效的。 我試圖禁用該字段,但沒有運氣。 的代碼是: <input type="text" ng-hide="param.paramType == 'java.lang.boo

    -1熱度

    1回答

    我正在使用表單來獲取用戶詳細信息。在我的名字輸入中,我只想要字母字符,空格和撇號。因此,我創建像 <input placeholder="FULL NAME" type="text" ng-model="customer.name" ng-pattern="/([a-zA-Z'\s])+/" ng-required="true"> 輸入形式。然而在我的形式,如果我給輸入連字符或下劃線它仍然採取

    2熱度

    1回答

    的範圍正則表達式我有一個輸入的字段,它看起來像 <input class="inputMargin urlInputWidth" type="text" size="40" name="url" ng-model="user.customerId" maxlength="250" ng-pattern="/sftp://.+/" /> 它工作正常,並顯示驗證預期。我只是想將這個模式轉移到ang