在ASP.NET a RequiredFieldValidator中仍然验证了文本框控件,即使我在客户端禁用它。我想通过使用CustomValidator摆脱此行为。在验证功能中,我检查是否启用了文本框。如果是这种情况,我将验证器设置为有效。 function ValidateTextBox(sender, args) {
var $textbox = $('#txtFoo')
在我的Rails应用程序中,我有一个Like模型。 ### like.rb
### Custom Validator Code:
class UniquenessValidator < ActiveModel::Validator
def validate(record)
# Empty
end
end
class Like < ActiveRecord:
应用验证属性 我有一个视图模型 [CustomValidation(typeof(MyValidation), "MyMethod")]
[Serializable()]
public class TransactionViewModel
{
public string InvoiceNumber;
}
public class MyVali