Hi Chris
You are right, if i uncomment the line alert(e) I'm receiving 0 , so is not passing the value as you said.
I'm integrate your calendar in a yacht solution website where i need to be able to show at list 5 different type of booking:
green -> owner booking
red--> provisional booking
blue-> charter booking and so on
What i try to do is avoid using the shit key or alt key or ctrl key but use just letter.
For example for provisional booking hold the 'p' and click
for owner bookings hold the 'o' and click
for charter booking hold 'c' and click and so on.
I have a look at your example here
http://www.cbolson.com/code/availability-calendar/version2.0/ and look at the update_cal.js you are using this function to be able to use the 'o' for provisional booking
- Code: Select all
function ajax_mod_state(id_item,the_date,the_num,e){
//catch key press
keycode=document.getElementById('current_key').value;
special_state="";
if(keycode=="16") special_state= "pm"; // SHIFT KEY
else if(keycode=="17") special_state= "pm"; // ctrl
else if(keycode=="18") special_state= "am"; // alt
else if(keycode=="80") special_state= "prv" // o
//else the_key= "ko";
I have tried to implemented in my version but i'm getting undefined error on current_key...
So that's why i was try to use this code
- Code: Select all
function what_key(e) {
if(document.all)e = event; // IE need this
//alert(e);
if(e.ctrlKey) return "am";
else if(e.altKey) return "pm";
else if(e.shiftKey) return "pr";
else if(112) return "ow";
else return "ko";
}
Thanks for your help
Em