Hello,
I am creating an Asp.net MVC web site. I am going to use the text box with validation.
Here is my code in .cshtml file,
@(Html.Infragistics().TextEditor() .ID("textEditor") .Width(160) .Required(true) .ValidatorOptions(m => m.OnSubmit(false).OnChange(true).OnBlur(true).ShowIcon(true)) .Render())
the text box border will be red it lost focus without typing nothing, but no message pop up, also a error occurred, it says: expr.replace is not a function
It seems I didn't include js correcly, is anyone know which component I should include?
Hi,
The validator requires 1 css and 1 js file. For versions 11.2 and lower those are
ig.ui.validator.cssig.ui.validator.js
and for versions 12.1 and higher those are
infragistics.ui.validator.cssinfragistics.ui.validator.js
It still has an error said "expr.replace is not a function", I am not sure why?
Hi Viktor Snezhko,
I solved the problem, the reason is the Asp.net MVC3 default jQuery version is 1.5.1, but the Infragistics needs jQuery 1.6.2 support, I replaced jQuery, it works.
Hi,For version 12.1, installation should provide infragistics.ui.validator.js/css files, so, they can be used by your application.You may include all js/css (for all Infragistics widgets/controls) manually, or you may use loader.js which was added to 12.1 in order to simplify handling js/css files.The Mvc helpers for 12.1 internally use loader to load/register js and css files defined by helpers in views. In order to use loader for igValidator, application may insert into <head> following:
<script type="text/javascript" src="pathToInfragisticsResources/js/infragistics.loader.js"></script>
<script type="text/javascript"> $.ig.loader({ scriptPath: 'pathToInfragisticsResources/js/', cssPath: 'pathToInfragisticsResources/css/', resources: 'igValidator,igShared' });</script>
Where the pathToInfragisticsResource should point to the location of js/css files used by widgets.In this case resource js/css filed required by igValidator will be loaded automatically.
As an example, you may look at online jquery samples at http://samples.infragistics.com/jquery/editors/editors-validationYou may test how it runs, look at CODE VIEW for aspx/cshtml files, and look at source of generated html. You should find statement similar which I mentioned.