Validation Form Scheduler

I’ve created a custom form into a scheduler.
How can I check data befor save them?
Have you got any example? (using .net razor engine…)

Regards.

There is a several ways to create custom form:
With native scheduler lightbox you’ll have to do some client-side(js) coding - you’ll need to attach onEventSave event to the scheduler, and check lightbox fields manually.
If you use custom lightbox(which can be attached by ‘DHXScheduler.Lightbox.SetExternalLightboxForm’ or ‘DHXScheduler.Lightbox.SetExternalLightbox’ methods) you may use mvc validation with jquery

so if you tell me which customization you use(native lightbox controls, or ‘SetExternalLightboxForm’, or SetExternalLightbox), i can send you a sample

Hi.

I’m using native Lightbox.
I’m sending you an example.

On save, I’d like to check if appuntamento or localita are == “”.

Regards.
Esempio.zip (1.71 KB)

you may use something like this
js:

        scheduler.attachEvent("onEventSave", function (id, data, is_new_event) {
            if (!data.localita || !data.appuntamento) {
                alert("Text too small");
                return false;
            }
            return true;
        })

‘data’ contains all properties of the appointment.
you may put this code right after scheduler.render call

@Html.Raw(Model.Render()) <script> scheduler.attachEvent("onEventSave", function (id, data, is_new_event) { if (!data.localita || !data.appuntamento) { alert("Text too small"); return false; } return true; }) </script>

Ty!

It works!