Half day bookings different key to choose

Re: Half day bookings different key to choose

Postby boldfish » Tue Apr 08, 2008 4:24 pm

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!

;)
boldfish
 
Posts: 25
Joined: Fri Apr 04, 2008 10:04 am

Re: Half day bookings different key to choose

Postby chris » Tue Apr 08, 2008 4:25 pm

no, not a feature.... I'm still at it.

Are you trying this on a mac?

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Half day bookings different key to choose

Postby boldfish » Tue Apr 08, 2008 4:27 pm

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)
boldfish
 
Posts: 25
Joined: Fri Apr 04, 2008 10:04 am

Re: Half day bookings different key to choose

Postby boldfish » Tue Apr 08, 2008 4:31 pm

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…)
boldfish
 
Posts: 25
Joined: Fri Apr 04, 2008 10:04 am

Re: Half day bookings different key to choose

Postby chris » Tue Apr 08, 2008 5:20 pm

OK, can you check my version out now - I think that I have it working but I might be missing something :roll:

Chris
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Half day bookings different key to choose

Postby boldfish » Tue Apr 08, 2008 6:44 pm

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...
boldfish
 
Posts: 25
Joined: Fri Apr 04, 2008 10:04 am

Re: Half day bookings different key to choose

Postby chris » Tue Apr 08, 2008 7:00 pm

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
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Half day bookings different key to choose

Postby boldfish » Tue Apr 08, 2008 7:09 pm

A thought: could you add an onblur to reset the key special state?
boldfish
 
Posts: 25
Joined: Fri Apr 04, 2008 10:04 am

Re: Half day bookings different key to choose

Postby chris » Tue Apr 08, 2008 7:48 pm

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
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

Re: Half day bookings different key to choose

Postby chris » Tue Apr 08, 2008 8:10 pm

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
User avatar
chris
Site Admin
 
Posts: 1089
Joined: Mon Dec 17, 2007 7:42 pm
Location: Málaga, Spain

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 0 guests

cron