How to do validation in the dropdown of the lightbox?

My scheduler contains 3 dropdowns(select) in the lightbox. If anyone is not selected save action catches exception and set action.Type to DataActionTypes.Error .

[code]  public ActionResult Save(string mode, int? ObjectId, FormCollection actionValues)
    {
        var action = new DataAction(actionValues);
        var changedEvent = (Event)DHXEventsHelper.Bind(typeof(Event), actionValues);

        int check_exist = _iManageVacancy.CheckExistingProperty(Convert.ToInt32(ObjectId), Convert.ToInt32(changedEvent.property_id));
        action.Type = check_exist == 0 ? DataActionTypes.Insert : DataActionTypes.Update;
            try
            {
                if (mode == "lead")
                {
                    switch (action.Type)
                    {
                        case DataActionTypes.Insert:
                            changedEvent.id = _iManageVacancy.AddNewEvent(changedEvent, Convert.ToInt32(ObjectId), Convert.ToInt32(changedEvent.property_id));
                            break;
                        default:// "update"      
                            if (check_exist != 0)
                                changedEvent.id = check_exist;
                            changedEvent.id = _iManageVacancy.UpdateEvent(changedEvent, Convert.ToInt32(ObjectId), Convert.ToInt32(changedEvent.property_id));
                            break;
                    }
                    action.TargetId = changedEvent.id;
                }
                else if (mode == "workorder")
                {
                    switch (action.Type)
                    {
                        default: // "updated"
                            changedEvent.id = _iManageMaintanence.UpdateEvent(changedEvent);
                            break;
                    }
                }
            }
            catch (Exception a)
            {
                action.Type = DataActionTypes.Error;
            }
        return new AjaxSaveResponse(action);
    }[/code]

But how to show that error to users as an alert?

Hi,
you can validate select boxes on the client, as described here:
scheduler-net.com/docs/validatio … lightboxes

In order to process response from the server with onAfterUpdate event of dhtmlxDataProcessor (the component that is built-in into the scheduler and responsible for interaction with the server side). If you pass any message with an error, it will be available as inner text of the ‘tag’ parameterscheduler.dataProcessor.attachEvent("onAfterUpdate", function(sid, action, tid, tag){ if (action == "error"){ //do something } })
docs.dhtmlx.com/doku.php?id=dhtm … fterupdate

For showing alerts or messages to the client, you can use dhtmlxMessage (another built-in component)
docs.dhtmlx.com/doku.php?id=dhtmlxmessage:notice
docs.dhtmlx.com/doku.php?id=dhtmlxmessage:toc

Thank You :slight_smile: It works fine…