Hi All,
i have below code,
i want to make the field mandatory by passing the var isReason as boolean true/false into the scheduler config; required: isReason as below, however is seem not working. Kindly refer to bold section … & please advise:-
[b]
var isReason=false;
var isAttach=false;
var isRel=false;
[/b]
var select = scheduler.form_blocks.my_select;
scheduler.form_blocks.my_select = {
get_value : select.get_value,
set_value : function(node,value,ev){
mode = node.firstChild;
mode.value=value||"";
var selectEl = node.firstChild;
selectEl.onchange = function(e){
var index = selectEl.selectedIndex;
var val = selectEl.options[index].text;
$.ajax({
type: "POST",
async: false,
url: "<%=Url.Content("~/Calendar/getVal/")%>",
data: { 'type': val, 'legalentity_id': <%=Model.aspnet_Memberships[0].legalentity_id%> },
dataType: "json",
error: function (request) {
alert(request.responseText);
event.preventDefault();
},
success: function (result1,result2,result3) {
[b]
isReason=result1;
isAttach=result2;
isRel=result3;
[/b]
return false;
}
});
}
},
render : select.render,
focus : select.focus
}
//lightbox configuration
scheduler.config.lightbox.sections = [
{name:"LMS_LeaveTypes",map_to:"leavetype_id",type:"my_select",options:LMS_LeaveTypes},
{name:"description",height:100,map_to:"reason", [b]required: isReason[/b], type:"textarea",focus:!0},
{name:"LMS_Relationships",map_to:"maternity",type:"select",[b]required: isRel[/b], options:LMS_Relationships},
{name:"LMS_Relationships1",map_to:"rel_id",type:"rel_select",[b]required: isRel[/b], options:LMS_Relation},
{name:"attachment",height:30,map_to:"attachSlip",required: isAttach, type:"file"},
{name:"time",height:72,type:"time",map_to:"auto"}
];
Thank you.
Regards,
Micheale