Preventing insert of appointments without specifying subject in the Inline Form

Prevent inserting of appointments when no subject is specified in the Inline Form.

DESCRIPTION

At this moment you are not allowed to create appointments without specifying their subject in the Advanced Form. This is achieved with the help of RequiredFieldValidator in the Advanced Form. However there is no limitation when using the Inline Form.

SOLUTION

The solution is achieved by using JQuery. You'll need to subscribe to the OnClientFormCreated event and use the following code in the handler:

JavaScript:

functionOnClientFormCreated(sender, args) {

var$ = $telerik.$;

$(".rsAptEditConfirm").bind({

click: function() {

varsubject = $('.rsAptEditTextareaWrapper').children();

vartext = subject.val();

if(text == '') {

alert('Please insert a subject!');

returnfalse;

}

}

});

}

RESTRICTIONS:

Please note that if you subscribe to the server-side event OnFormCreated - you need to move the logic in the OnClientFormCreated event in the pageLoad():