We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to validate the fields of custom appointment form - JS Schedule?

Platform: jQuery |
Control: ejSchedule

The following steps show how to validate the fields added within the Schedule Custom Appointment window.


Step 1: Create Schedule sample with the Custom Appointment window by referring to the following links.

Sample Location: http://js.syncfusion.com/demos/web/#!/azure/schedule/CustomWindow

Help document Location: Using Customized Appointment window: http://docs.syncfusion.com/js/schedule/customization 


Step 2: Create the necessary customization Style class, and add it to the required fields within the Custom appointment window for validation purpose as follows.


    .error {
            background-color: #FF8A8A;
    .validation {
        border-color: red;



<script type="text/javascript">
    $("#subject").focusout(function () {
        if ($.trim($("#subject").val()) == "") { 
            $("#subject").addClass("validation");  // Validates subject.
            return false;
    $("#customdescription").focusout(function () {
        if ($.trim($("#customdescription").val()) == "") {
            $("#customdescription").addClass("validation");  // Validates description.
            return false;
    $("#EndTime").focusout(function () {
        if (new Date($("#EndTime").val()).getDate() >= new Date($("#StartTime").val()).getDate()) {
            if (new Date($("#StartTime").val()).getTime() >= new Date($("#EndTime").val()).getTime())         // Validates Time Interval.
                alert("End Time value is less than the Start Time value");


Step 3: Now, run the sample. Open the appointment window. Click the submit button without filling the subject and description fields. Then, check also for all other field validations as shown in the following screenshots.


Error in the field value

Figure 1: Error in the field value


Date time validation displayed in the alert message

Figure 2: Date time validation displayed in the alert message


Custom appointment form displayed without any error

Figure 3: Custom appointment form displayed without any error

Sample Link:


You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile