This is a migrated thread and some comments may be shown as answers.

Validation on edit

2 Answers 55 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 15 Jan 2015, 03:05 PM
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 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 19 Jan 2015, 09:38 AM
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.

 
0
Alan Mosley
Top achievements
Rank 1
answered on 19 Jan 2015, 11:17 AM
sorry to waster your time, I got my e.preventDefault(); e.stopPropagation(); mixed up.
thanks
‚Äč
Tags
Scheduler
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Alan Mosley
Top achievements
Rank 1
Share this question
or