I am trying to prepopulate certain data in the advanced form client side. Regardless of what I do when the form opens the subject field is blank and i get the validation warning to enter a subject...
Here is my code can you please tell me what i am doing wrong and thanks
<script type="text/javascript"> function AdjustHeader(obj, args) { if (args.get_item().get_text().indexOf('Availability') > 0) formatAppointment(true); else if (args.get_item().get_text().indexOf('Class') > 0) formatAppointment(false); } function formatAppointment(isPriv) { $(".rsAllDayWrapper").hide(); var subjectJQueryObject = $telerik.$("[id$='Form_Subject']"); var subjectRadTextBoxObject = $find(subjectJQueryObject.attr("id")); alert(subjectJQueryObject.attr("id")); if (isPriv) { $(".rsAdvTitle").html("New Private Session Availability"); subjectRadTextBoxObject.set_value("Open for private training"); $("#" + idPrefix + "Subject_Label").html(" ") } else { $(".rsAdvTitle").html("New Group Class"); $("#" + idPrefix + "Subject_Label").html("Class Name") } }</script>
<telerik:RadScheduler RenderMode="Lightweight" runat="server" ID="schedTrainer" Height="590" OverflowBehavior="Auto" SelectedView="WeekView" ShowFooter="false" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true" AppointmentStyleMode="Default" Skin="Telerik" OnResourcesPopulating="schedTrainer_ResourcesPopulating" OnClientResourcesPopulating="popUser" OnClientAppointmentsPopulating="popUser" OnClientAppointmentWebServiceDeleting="popUser" OnClientAppointmentWebServiceUpdating="popUser" OnClientAppointmentWebServiceInserting="popUser" StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true" DayView-ShowAllDayInsertArea="false" MultiDayView-ShowAllDayInsertArea="false" WeekView-ShowAllDayInsertArea="false" ShowAllDayRow="false" OnClientTimeSlotContextMenuItemClicking="AdjustHeader" > <AdvancedForm EnableResourceEditing="false" /> <TimeSlotContextMenus> <telerik:RadSchedulerContextMenu runat="server" ID="TimeContextMenu"> <Items> <telerik:RadMenuItem Text="Add Recurring Availability" Value="CommandAddRecurringAppointment" /> <telerik:RadMenuItem Text="Add Recurring Class" Value="CommandAddRecurringAppointment" /> <telerik:RadMenuItem IsSeparator="True" /> <telerik:RadMenuItem Text="Add Spot Availability" Value="CommandAddAppointment" /> <telerik:RadMenuItem Text="Add Spot Class" Value="CommandAddAppointment" /> <telerik:RadMenuItem IsSeparator="True" /> <telerik:RadMenuItem Text="Go to today" Value="CommandGoToToday" /> <telerik:RadMenuItem Text="Show 24 hours..." Value="CommandShow24Hours" /> </Items> </telerik:RadSchedulerContextMenu> </TimeSlotContextMenus> <WebServiceSettings Path="../../WebService/Scheduler.asmx" ResourcePopulationMode="ClientSide" /> <AdvancedForm Modal="true"></AdvancedForm> <TimelineView UserSelectable="false"></TimelineView> <AgendaView UserSelectable="true" /> <ResourceStyles> <%--AppointmentStyleMode must be explicitly set to Default (see above) otherwise setting BackColor/BorderColor will switch the appointments to Simple rendering (no rounded corners and gradients)--%> <telerik:ResourceStyleMapping Type="Calendar" Text="Personal" BorderColor="#abd962" /> <telerik:ResourceStyleMapping Type="Calendar" Text="Work" BorderColor="#25a0da" /> </ResourceStyles> <ResourceHeaderTemplate> <div class="rsResourceHeader<%# Eval("Text") %>"> <%# Eval("Text") %> </div> </ResourceHeaderTemplate> <TimeSlotContextMenuSettings EnableDefault="true" /> <AppointmentContextMenuSettings EnableDefault="true" /> <Localization HeaderWeek="Work week" /></telerik:RadScheduler>