I have a numericeditor in mvc code as:
It's ok with:
$('#numtest).igNumericEditor({value: "0",validatorOptions: {onblur: true,required: true,custom: function (value, opt) { return (value > 0);} }});
@Html.Infragistics.NumericEditor("numtest", "numtest", 0).ValidatorOptions(Sub(o) o.OnBlur(True) o.Required(True) o.Custom("function (value, opt) { return (value > 0);}", "Value must be greater than zero") End Sub).Render
What is syntax for o.Custom("???", "error msg")?
Hello Quan,
Thank you for using our community.
The syntax of the custom option is as follows:
@(Html.Infragistics().NumericEditor()
.ID("numericEditor")
.Value("0")
.ValidatorOptions(x=>
x.OnBlur(true)
.Required(true)
.Custom("validate", "Value must be greater than zero"))
.Render())
<script>
function validate(value) {
return (value > 0);
}
</script>
If you need further assistance, don’t hesitate to contact me.
Best Regards, Marina Stoyanova, Software Developer, Infragistics, Inc.