Validate a div element

2 posts, 0 answers
  1. Matt
    Matt avatar
    43 posts
    Member since:
    May 2013

    Posted 17 Dec 2013 Link to this post

    I have a two boxes that were previously input elements and are now inline html editors. Can any other element that are not a 'input' element be added onto the validator's list of things to check. The use is in a list view. Or would the only solution be having some hidden elements?
    1.<div class="WebDescriptionEditor" data-bind="value: WebDescription" data-role="editor"
    2.   contentEditable="true"
    3.   data-tools="['bold','italic','underline','strikethrough']">
    Thats basically it. The work around i have otherwise is to include a hidden input element after each of the the divs as so:
    1.<input type="hidden" name="WebDescription" data-bind="value: WebDescription" />
    Then the custom validation on the datasource iterates through the input elements and validates the above. Any way to skip having the extra html?

  2. Alexander Popov
    Alexander Popov avatar
    1411 posts

    Posted 19 Dec 2013 Link to this post

    Hi Matt,

    Yes, validating div elements is possible using the Validator's validateInput method, as shown in this small example.

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top