Validation on edit

3 posts, 0 answers
  1. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 15 Jan 2015 Link to this post

    I have some JavaScript running in the save event of the edit window of the scheduler to validate some input, if the validation fails I want to stop the windpow from closing, how can I do this?
    I have tried
    event.stopPropagation();
    return false

    Thanks
  2. Alexander Popov
    Admin
    Alexander Popov avatar
    1416 posts

    Posted 19 Jan 2015 Link to this post

    Hi Alan,

    Calling the e.preventDefault() method inside the save event's handler should prevent the Window from closing. For example: 
    function onSave(e){
     if(!condition){
       e.preventDefault();
      }
    }

    Regards,
    Alexander Popov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Alan Mosley
    Alan Mosley avatar
    200 posts
    Member since:
    Apr 2010

    Posted 19 Jan 2015 in reply to Alexander Popov Link to this post

    sorry to waster your time, I got my e.preventDefault(); e.stopPropagation(); mixed up.
    thanks
Back to Top