Page 3 of 4

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 4:24 pm
by boldfish
What happens now is that I press p and click, it shows the alert.

if I click again (without touching the keys) it still shows the alert. so i can't get a normal click until i press a different key and then click

if that's a feature of the alert box, then no probs, but i can see my client getting weird over a persistent provisional state!

;)

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 4:25 pm
by chris
no, not a feature.... I'm still at it.

Are you trying this on a mac?

Chris

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 4:27 pm
by boldfish
I think something broke - it happens if i press any of the modifier keys before clicking the date.

i.e. pressing shift and then not using the keyboard, the first time I click a date I get PM booked

(on a mac)

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 4:31 pm
by boldfish
just checked and my original is functioning as expected.

click to book, click to unbook, hold alt or shift and click to get am or pm

something you've done on this 'p' version is hanging onto the last keypress (not initialising the variable? - straw grasp…)

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 5:20 pm
by chris
OK, can you check my version out now - I think that I have it working but I might be missing something :roll:

Chris

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 6:44 pm
by boldfish
almost?

press p and click and you get provisional, click a provisional booking and it goes provisional again. click it again an it becomes free.

it would be better of course for it to go provisional click booked or provisional click free, but I suppose it's a quirk that could be lived with.

it still goes provisional if you press p and click, as opposed to hold p and click, which seems to be why it's going provisional again...

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 7:00 pm
by chris
This is one of those annoying javascript moments. if I do an alert and then "empty" the keystroke value it works, however, without the alter it doesn't :(
Code: Select all
alert(the_url);
   keycode="";
   special_state="";


Very annoying! - ever come up against this sort of "bug" before?

Chris

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 7:09 pm
by boldfish
A thought: could you add an onblur to reset the key special state?

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 7:48 pm
by chris
OK, I've given that a go (I presume you mean on the number image) but all it does is clear the state before it even gets changed so it always returns available or booked :(
This is so annoying! I have tried putting the
Code: Select all
keycode="";special_state="";
all over the place (I actually think the only problem is the keycode one) but I can only get it to work with an alert.

Isn't it incredible how one can spend half a day with just one silly problem :roll:

I won't sleep tonight until I can work this out!

Chris

Re: Half day bookings different key to choose

PostPosted: Tue Apr 08, 2008 8:10 pm
by chris
Can you take another look ;)
I have had to go the most round about way thinkable:

detect keycode on keydown > write to hidden text field (not hidden at the moment) > get this value in the js function to define new state > call ajax > empty formfield on keyup

It "appears" to work though I really don't like it :(

Chris