In my lightbox I am trying to get the selected value that was selected in the section drop down and make it the header value. How can I get the selected value clicked by the user.
Also I would like to seed the two text areas in the lightbox form based on users name and phone how would I set these values.
// Settings for the Sheduler
function init() {
var user = $('#cName').val();
var sections=[
{key:1, label:"Men's Cut"},
{key:2, label:"Color"},
{key:3, label:"Women's Cut"},
{key:4, label:"Wax"},
{key:5, label:"Child Cut (under 3 yrs old)"},
{key:6, label:"Nails - Pedicure"},
{key:7, label:"Nails - Manicure"},
{key:8, label:"Other"}
];
if (!user.match('admin')){
scheduler.config.limit_start = new Date();
scheduler.config.limit_end = new Date(2012,12,31);
scheduler.config.limit_view = true;
// scheduler.config.drag_move = false;
} else {
scheduler.config.limit_start = new Date(2012, 1, 1);
scheduler.config.limit_end = new Date(2013,1,1);
scheduler.config.collision_limit = 2;
}
scheduler.config.multi_day = true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.first_hour= 9;
scheduler.config.last_hour = 20;
scheduler.config.hour_date="%h:%i %A";
scheduler.config.wide_form = true;
scheduler.config.event_duration = 30;
scheduler.config.auto_end_date = true;
scheduler.config.limit_time_select = true;
scheduler.config.time_step = 30;
scheduler.locale.labels.section_description ="Client";
scheduler.config.details_on_dblclick=true;
scheduler.config.details_on_create=true;
scheduler.config.lightbox.sections=[
{name: "description", height: 20, map_to: "clientName", type: "textarea"},
{name: "custom2", height: 20, map_to: "phone", type: "textarea"},
{name:"custom", height:33, type:"select", options:sections, map_to:"section_id", focus:true },
{name:"time", height:72, type:"time", map_to:"start_time"}
];
scheduler.templates.lightbox_header = function(event){
// what code goes here <---------------------------------------
}
scheduler.locale.labels.section_custom="Service";
scheduler.locale.labels.section_custom2="Phone";
// Set days of week blocked out
scheduler.blockTime(0, "fullday");
scheduler.blockTime(1, "fullday");
scheduler.blockTime(2, [9*60,10*60]);
scheduler.blockTime(3, [9*60,10*60,18*60,24*60]);
scheduler.blockTime(4, [9*60,10*60,18*60,24*60]);
scheduler.blockTime(5, [15*60,24*60]);
scheduler.blockTime(6, [13*60,24*60]);
scheduler.attachEvent("onEventCollision", function (event_id){
if (!user.match('admin'))
alert("Sorry, I'm Booked at that Time");
else
alert("A Client is already booked at that time");
deleteEvent(event_id);
});
scheduler.attachEvent("onEventAdded", function(event_id,event_object){
//alert(event_id);
});
scheduler.attachEvent("onEventChanged", function(event_id,event_object){
// alert(event_id);
//alert(get)
});
if (!user.match('admin'))
scheduler.init('scheduler_here',new Date(),"week");
else
scheduler.init('scheduler_here',new Date(),"month");
//scheduler.setLoadMode("month");
// Loads data from a configured database conection.
scheduler.load("data.php");
var dp = new dataProcessor("data.php");
dp.init(scheduler);
}; // end init()