Disable/Enable Validation

3 posts, 1 answers
  1. Tommy
    Tommy avatar
    4 posts
    Member since:
    Jun 2014

    Posted 20 Jan 2015 Link to this post

    I'm trying to disable and enable validation depending on the user selection. On my solution i would like to only validate if the user enters a start or end date. So far if you look at part of my solution code(copied to kendo ui dojo http://dojo.telerik.com/uyOHa )  i have some of the validation working. I will put down a couple of scenario on how i need it to work.

    scenario 1(working)

    User doesn't enter dates, Validation not needed

    scenario 2(working)

    User enters a start or end date. This will validate the text boxes.

    scenario 3(NOT WORKING)

    User enters start and end date. Click Search. Then Clear both date fields and validation is how showing for these two text boxes. I wish to have the validation hidden at this point. The only way i can do this so far is by clearing the text boxes then hitting search again.

    Thanks in advance!
  2. Answer
    Daniel
    Admin
    Daniel avatar
    2117 posts

    Posted 22 Jan 2015 Link to this post

    Hello Tommy,

    I am not sure if I understand the logic in the provided dojo. The example uses multiple validators initialized each time the button is clicked and check if the inputs have value only in the click handler. I updated the example to use an alternative approach with a single validator and a rule that checks the other input and then revalidates it if needed. Please check it and let me know if works for you.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Tommy
    Tommy avatar
    4 posts
    Member since:
    Jun 2014

    Posted 22 Jan 2015 in reply to Daniel Link to this post

    Hi Daniel,

    This makes more sense and it works now! Thanks a million!

    Regards,

    Tommy
Back to Top