Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
How to validate WebEditor through javascript
posted

hi!

   I want to validate if WebEditor is null or not having any text please help me.

Parents
No Data
Reply
  • 24497
    posted

    Hi,

    If you are interested in changes, then it is better to process ClientSideEvents.ValueChange/TextChanged/InvalidValue. If you need a current value in editor, then you may use getValue(), getText() and other more specific member functions for a specific editor. Please consult CSOM docs for editors. Below an example:

    <igtxt:WebNumericEdit ID="WebNumericEdit1" runat="server"></igtxt:WebNumericEdit>
    <igtxt:WebMaskEdit ID="WebMaskEdit1" runat="server" InputMask="(###)###-####" DataMode="RawText"></igtxt:WebMaskEdit>

    <script type="text/javascript">
    function checkVal()
    {
      
    var str = '';
     
    var num = igedit_getById('WebNumericEdit1');
     
    if(num)
         str +=
    "Numeric value='" + num.getValue() + "'\n";
     
    var mask = igedit_getById('WebMaskEdit1');
     
    if(mask)
         str +=
    "Text in maskedit='" + mask.getValue() + "'";
      window.alert(str);
    }
    </script>

    <input type="button" value="check values" onclick="checkVal()" />

    Regards,
    Viktor
    Infragistics web team

Children
No Data