[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-31 Thread Christophe Decaux
That's right, it's device app dev.
The device is a Cisco DMP 4300 series
Does anyone knows what are the minimum browser requirements to run  
Prototype and Scriptaculous
Christophe

Le 30 juil. 09 à 22:40, Rick Waldron a écrit :

 That sounds like fun... i like device app development. Can you tell  
 us what device you're working with? That will be helpful

 Rick

 On Thu, Jul 30, 2009 at 3:55 PM, Christophe christophe.dec...@gmail.com 
  wrote:

 Hi there,

 Apologies to everybody if my question is offending in any way, but
 this is my first post to such a group.

 I'm a occasional user of Prototype and Scriptaculous and pretty happy
 with these tools.

 However, I'm facing an issue for which I can find any answer around:

 I created some pages that work pretty well on modern browsers such as
 FF 3 or 3.5 and Safari 3 or 4, but I'm asked to make them run on some
 special Internet devices that run only Mozilla Firefox 1.7 with
 Javascript 1.5

 So my question is : what are the requirements of Prototype 1.6 and
 Scriptaculous 1.8, will my pages run well on such an old browser.
 If not, is there an older version of Prototype and/or Scriptaculous
 that will answer my problem.

 Thanks in advance

 Christophe




 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

Hi

Thanks for the help, I tried the above in  a clean page but I can't
get it to work, the code as I've implemented it is here:

script src='http://pastie.org/566433.js'/script

Can you see where I've gone wrong (it's almost definately my fault) :)

Cheers
Andy

On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 A couple of things i would do.

 First i would remove the onlick and assign the elements a classname
 something like this will work

 http://pastie.org/565060

 HTH

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Thursday, July 30, 2009 10:42 AM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 The code is being echoed in a php script (hence the $row and $class
 variables but they do translate properly) I've pasted it below:

 onclick=Effect.morph(lastPlayed , {'style: $class'}), $('$row
 [TrackID]').morph('background:#ffcc33;'),var lastPlayed = ''$row
 [TrackID]';

 This is one of my many failed attempts.

 Thanks for the help

 Cheers
 Andy

 On Jul 30, 10:26 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Can you give an example of your code in a pastebin and i will ammend it to
  do what it needs to.

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Thursday, July 30, 2009 10:23 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I'm not really sure how to, I've been messing with it for a couple of
  days to no avail.

  I have been trying to use a variable to achieve this so that th
  onClick does the following in this order:

  1./ Reset the morph effect on the lastPlayed element
  2./ Apply the morph effect to the clicked element
  3./ Set the lastPlayed variable to match the id of the clicked
  element.

  Among other errors I've recieved is that lastPlayed is undefined but I
  think this may be down to me not knowing how to use a variable instead
  of an element id in the morph statment.

  Cheers
  Andy

  On Jul 28, 10:39 pm, Andy Daykin daykina...@gmail.com wrote:
   Why don't you use an array to store all of the elements that have been
   clicked and treat it like a queue?

   --
   From: Andrew Dodd a...@slicethepie.com
   Sent: Tuesday, July 28, 2009 7:02 AM
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Subject: [Proto-Scripty] Effect.Morph query

Hi

I page with multiple elements each of which are highlighted
(individually) onclick.

I would like the morph effect to be removed from the previous element
when a new one is clicked (highlighted).

I won't know what the id of the previous element was though, is there
a way to achieve this?

Cheers
Andy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

Andy you completely disregarded the onclick notes i gave you and mangled the 
script.

http://pastie.org/566455

That works completely fine... all you ahev to do is remve the
script src=/resources/includes/client/shrunkpse.js 
type=text/javascript/script
Block and put in your paths to prototype,scriptaculous,effects and it works 
how you want it to.

HTH

(stay away form onlick)!!

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 9:54 AM
Subject: [Proto-Scripty] Re: Effect.Morph query



Hi

Thanks for the help, I tried the above in  a clean page but I can't
get it to work, the code as I've implemented it is here:

script src='http://pastie.org/566433.js'/script

Can you see where I've gone wrong (it's almost definately my fault) :)

Cheers
Andy

On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 A couple of things i would do.

 First i would remove the onlick and assign the elements a classname
 something like this will work

 http://pastie.org/565060

 HTH

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Thursday, July 30, 2009 10:42 AM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 The code is being echoed in a php script (hence the $row and $class
 variables but they do translate properly) I've pasted it below:

 onclick=Effect.morph(lastPlayed , {'style: $class'}), $('$row
 [TrackID]').morph('background:#ffcc33;'),var lastPlayed = ''$row
 [TrackID]';

 This is one of my many failed attempts.

 Thanks for the help

 Cheers
 Andy

 On Jul 30, 10:26 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Can you give an example of your code in a pastebin and i will ammend it 
  to
  do what it needs to.

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Thursday, July 30, 2009 10:23 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I'm not really sure how to, I've been messing with it for a couple of
  days to no avail.

  I have been trying to use a variable to achieve this so that th
  onClick does the following in this order:

  1./ Reset the morph effect on the lastPlayed element
  2./ Apply the morph effect to the clicked element
  3./ Set the lastPlayed variable to match the id of the clicked
  element.

  Among other errors I've recieved is that lastPlayed is undefined but I
  think this may be down to me not knowing how to use a variable instead
  of an element id in the morph statment.

  Cheers
  Andy

  On Jul 28, 10:39 pm, Andy Daykin daykina...@gmail.com wrote:
   Why don't you use an array to store all of the elements that have been
   clicked and treat it like a queue?

   --
   From: Andrew Dodd a...@slicethepie.com
   Sent: Tuesday, July 28, 2009 7:02 AM
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Subject: [Proto-Scripty] Effect.Morph query

Hi

I page with multiple elements each of which are highlighted
(individually) onclick.

I would like the morph effect to be removed from the previous 
element
when a new one is clicked (highlighted).

I won't know what the id of the previous element was though, is 
there
a way to achieve this?

Cheers
Andy



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

Sorry, forgot to mention I was an idiot :)

Thanks very much it works brilliantly

On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Andy you completely disregarded the onclick notes i gave you and mangled the
 script.

 http://pastie.org/566455

 That works completely fine... all you ahev to do is remve the
 script src=/resources/includes/client/shrunkpse.js
 type=text/javascript/script
 Block and put in your paths to prototype,scriptaculous,effects and it works
 how you want it to.

 HTH

 (stay away form onlick)!!

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 9:54 AM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Hi

 Thanks for the help, I tried the above in  a clean page but I can't
 get it to work, the code as I've implemented it is here:

 script src='http://pastie.org/566433.js'/script

 Can you see where I've gone wrong (it's almost definately my fault) :)

 Cheers
 Andy

 On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  A couple of things i would do.

  First i would remove the onlick and assign the elements a classname
  something like this will work

 http://pastie.org/565060

  HTH

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Thursday, July 30, 2009 10:42 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  The code is being echoed in a php script (hence the $row and $class
  variables but they do translate properly) I've pasted it below:

  onclick=Effect.morph(lastPlayed , {'style: $class'}), $('$row
  [TrackID]').morph('background:#ffcc33;'),var lastPlayed = ''$row
  [TrackID]';

  This is one of my many failed attempts.

  Thanks for the help

  Cheers
  Andy

  On Jul 30, 10:26 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Can you give an example of your code in a pastebin and i will ammend it
   to
   do what it needs to.

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Thursday, July 30, 2009 10:23 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   I'm not really sure how to, I've been messing with it for a couple of
   days to no avail.

   I have been trying to use a variable to achieve this so that th
   onClick does the following in this order:

   1./ Reset the morph effect on the lastPlayed element
   2./ Apply the morph effect to the clicked element
   3./ Set the lastPlayed variable to match the id of the clicked
   element.

   Among other errors I've recieved is that lastPlayed is undefined but I
   think this may be down to me not knowing how to use a variable instead
   of an element id in the morph statment.

   Cheers
   Andy

   On Jul 28, 10:39 pm, Andy Daykin daykina...@gmail.com wrote:
Why don't you use an array to store all of the elements that have been
clicked and treat it like a queue?

--
From: Andrew Dodd a...@slicethepie.com
Sent: Tuesday, July 28, 2009 7:02 AM
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Effect.Morph query

 Hi

 I page with multiple elements each of which are highlighted
 (individually) onclick.

 I would like the morph effect to be removed from the previous
 element
 when a new one is clicked (highlighted).

 I won't know what the id of the previous element was though, is
 there
 a way to achieve this?

 Cheers
 Andy
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

You;re more than welcome

That will give you he basis on how to do this kinda stuff without onclick!

Anything else just let me/the group know

Regards

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 10:59 AM
Subject: [Proto-Scripty] Re: Effect.Morph query



Sorry, forgot to mention I was an idiot :)

Thanks very much it works brilliantly

On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Andy you completely disregarded the onclick notes i gave you and mangled 
 the
 script.

 http://pastie.org/566455

 That works completely fine... all you ahev to do is remve the
 script src=/resources/includes/client/shrunkpse.js
 type=text/javascript/script
 Block and put in your paths to prototype,scriptaculous,effects and it 
 works
 how you want it to.

 HTH

 (stay away form onlick)!!

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 9:54 AM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Hi

 Thanks for the help, I tried the above in a clean page but I can't
 get it to work, the code as I've implemented it is here:

 script src='http://pastie.org/566433.js'/script

 Can you see where I've gone wrong (it's almost definately my fault) :)

 Cheers
 Andy

 On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  A couple of things i would do.

  First i would remove the onlick and assign the elements a classname
  something like this will work

 http://pastie.org/565060

  HTH

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Thursday, July 30, 2009 10:42 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  The code is being echoed in a php script (hence the $row and $class
  variables but they do translate properly) I've pasted it below:

  onclick=Effect.morph(lastPlayed , {'style: $class'}), $('$row
  [TrackID]').morph('background:#ffcc33;'),var lastPlayed = ''$row
  [TrackID]';

  This is one of my many failed attempts.

  Thanks for the help

  Cheers
  Andy

  On Jul 30, 10:26 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Can you give an example of your code in a pastebin and i will ammend 
   it
   to
   do what it needs to.

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Thursday, July 30, 2009 10:23 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   I'm not really sure how to, I've been messing with it for a couple of
   days to no avail.

   I have been trying to use a variable to achieve this so that th
   onClick does the following in this order:

   1./ Reset the morph effect on the lastPlayed element
   2./ Apply the morph effect to the clicked element
   3./ Set the lastPlayed variable to match the id of the clicked
   element.

   Among other errors I've recieved is that lastPlayed is undefined but I
   think this may be down to me not knowing how to use a variable instead
   of an element id in the morph statment.

   Cheers
   Andy

   On Jul 28, 10:39 pm, Andy Daykin daykina...@gmail.com wrote:
Why don't you use an array to store all of the elements that have 
been
clicked and treat it like a queue?

--
From: Andrew Dodd a...@slicethepie.com
Sent: Tuesday, July 28, 2009 7:02 AM
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Subject: [Proto-Scripty] Effect.Morph query

 Hi

 I page with multiple elements each of which are highlighted
 (individually) onclick.

 I would like the morph effect to be removed from the previous
 element
 when a new one is clicked (highlighted).

 I won't know what the id of the previous element was though, is
 there
 a way to achieve this?

 Cheers
 Andy



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Using a prototype function in dynamic content.

2009-07-31 Thread T.J. Crowder

Hi,

You're using the evalScripts option in your ajax call?  Can you
produce a small, self-contained example[1]?

[1] http://proto-scripty.wikidot.com/self-contained-test-page

-- T.J. :-)

On Jul 31, 1:22 am, Drum csteph2...@gmail.com wrote:
 P.S. I tried with both delete eds[id];  and eds[id] = undefined.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Autocomplete bug on Vista

2009-07-31 Thread Phpdeveloper

I am using script.aculo.us 1.8  Prototype 1.6 RC_3. I got the bug
with autocomplete on vista, the autocomplete popup and shifted couple
of pixel left. but when i remove dragdrop.js then works fine.But I
needed dragdrop.js, for dragdrop. take a look onto www.indianelement.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

I do have another question.

The list of elements is loaded with ajax, I think it is properly
formed for your script to work but it's here in case you want to
check:

http://pastie.org/566516

I think I need to run your script after each AJAX reload of the data
but I'm not sure how to achieve this, would the browser recognise the
script is I echo it in the php output from the file running the query?

Cheers
Andy




On Jul 31, 11:01 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 You;re more than welcome

 That will give you he basis on how to do this kinda stuff without onclick!

 Anything else just let me/the group know

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 10:59 AM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Sorry, forgot to mention I was an idiot :)

 Thanks very much it works brilliantly

 On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Andy you completely disregarded the onclick notes i gave you and mangled
  the
  script.

 http://pastie.org/566455

  That works completely fine... all you ahev to do is remve the
  script src=/resources/includes/client/shrunkpse.js
  type=text/javascript/script
  Block and put in your paths to prototype,scriptaculous,effects and it
  works
  how you want it to.

  HTH

  (stay away form onlick)!!

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 9:54 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  Hi

  Thanks for the help, I tried the above in a clean page but I can't
  get it to work, the code as I've implemented it is here:

  script src='http://pastie.org/566433.js'/script

  Can you see where I've gone wrong (it's almost definately my fault) :)

  Cheers
  Andy

  On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   A couple of things i would do.

   First i would remove the onlick and assign the elements a classname
   something like this will work

  http://pastie.org/565060

   HTH

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Thursday, July 30, 2009 10:42 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   The code is being echoed in a php script (hence the $row and $class
   variables but they do translate properly) I've pasted it below:

   onclick=Effect.morph(lastPlayed , {'style: $class'}), $('$row
   [TrackID]').morph('background:#ffcc33;'),var lastPlayed = ''$row
   [TrackID]';

   This is one of my many failed attempts.

   Thanks for the help

   Cheers
   Andy

   On Jul 30, 10:26 am, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
Can you give an example of your code in a pastebin and i will ammend
it
to
do what it needs to.

Regards

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Thursday, July 30, 2009 10:23 AM
Subject: [Proto-Scripty] Re: Effect.Morph query

I'm not really sure how to, I've been messing with it for a couple of
days to no avail.

I have been trying to use a variable to achieve this so that th
onClick does the following in this order:

1./ Reset the morph effect on the lastPlayed element
2./ Apply the morph effect to the clicked element
3./ Set the lastPlayed variable to match the id of the clicked
element.

Among other errors I've recieved is that lastPlayed is undefined but I
think this may be down to me not knowing how to use a variable instead
of an element id in the morph statment.

Cheers
Andy

On Jul 28, 10:39 pm, Andy Daykin daykina...@gmail.com wrote:
 Why don't you use an array to store all of the elements that have
 been
 clicked and treat it like a queue?

 --
 From: Andrew Dodd a...@slicethepie.com
 Sent: Tuesday, July 28, 2009 7:02 AM
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Subject: [Proto-Scripty] Effect.Morph query

  Hi

  I page with multiple elements each of which are highlighted
  (individually) onclick.

  I would like the morph effect to be removed from the previous
  element
  when a new one is clicked (highlighted).

  I won't know what the id of the previous element was though, is
  there
  a way to achieve this?

  Cheers
  Andy
--~--~-~--~~~---~--~~
You 

[Proto-Scripty] Re: Eventchain click and drag

2009-07-31 Thread ferion

Seems like i got the annoying (or the dumb) problems.
Does never anybody dealt with the Problem aof an Eventchain?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Eventchain click and drag

2009-07-31 Thread Alex McAuley

What was the original question ?



Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: ferion fer...@gmx.de
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 12:35 PM
Subject: [Proto-Scripty] Re: Eventchain click and drag



 Seems like i got the annoying (or the dumb) problems.
 Does never anybody dealt with the Problem aof an Eventchain?
 
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] W3C Access-Control with AJAX

2009-07-31 Thread mmacia

I'm trying to make cross domain AJAX calls using this specification
(http://www.w3.org/TR/cors/) and works well with Firefox and Webkit
browsers using directly the XMLHttpRequest object.

When I do the same using prototype Ajax object, fails.

The browser sends two requests to server using OPTION and POST
methods, but prototype only reaches to send an OPTION request, then
fails.

So my question is, can I use access-control in prototype passing some
magic arguments to Ajax.Request object?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

I've replaced the script with the new one but I'm struggling with the
syntax for including the initMorphing function. My AJAX request is
posted here:

http://pastie.org/566545

I've put the function where I think it should go but I'm not sure if
it's right, could you confirm?

Cheers
Andy

On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 You have a noticeable invalid spec on that pastie...

 The first is all of the buttons have the same id of  clearButton
 Element id's should be unique.

 If you're loading the bits via ajax then you will need to clean up the old
 function and bind a new one each time the ajax is called.

 There are many ways to do this, i prefer wrapping the $$().invoke(
 part of the script in its own funciton and calling that either at the bottom
 of the Ajax.Updater/Request or onSuccess.

 For garbage colleciton (unbinding the old binds and so on to keep a clean
 scope simply

 I have ammended the code and reposted it at

 http://pastie.org/566530

 I put in a self cleaning call into the funciton for you that will stop the
 observing and set the window.lastMorphed variable to null...

 This should keep the window scope clean and also remove the binding on
 elements that dont exist after an Ajax.Updater.

 You should call it in the 'onSuccess' part of your ajax

 something like

 onSuccess : function() {
     initMorphing();

 }

 HTH

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 12:13 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 I do have another question.

 The list of elements is loaded with ajax, I think it is properly
 formed for your script to work but it's here in case you want to
 check:

 http://pastie.org/566516

 I think I need to run your script after each AJAX reload of the data
 but I'm not sure how to achieve this, would the browser recognise the
 script is I echo it in the php output from the file running the query?

 Cheers
 Andy

 On Jul 31, 11:01 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You;re more than welcome

  That will give you he basis on how to do this kinda stuff without onclick!

  Anything else just let me/the group know

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 10:59 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  Sorry, forgot to mention I was an idiot :)

  Thanks very much it works brilliantly

  On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Andy you completely disregarded the onclick notes i gave you and mangled
   the
   script.

  http://pastie.org/566455

   That works completely fine... all you ahev to do is remve the
   script src=/resources/includes/client/shrunkpse.js
   type=text/javascript/script
   Block and put in your paths to prototype,scriptaculous,effects and it
   works
   how you want it to.

   HTH

   (stay away form onlick)!!

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 9:54 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Hi

   Thanks for the help, I tried the above in a clean page but I can't
   get it to work, the code as I've implemented it is here:

   script src='http://pastie.org/566433.js'/script

   Can you see where I've gone wrong (it's almost definately my fault) :)

   Cheers
   Andy

   On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
A couple of things i would do.

First i would remove the onlick and assign the elements a classname
something like this will work

   http://pastie.org/565060

HTH

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Thursday, July 30, 2009 10:42 AM
Subject: [Proto-Scripty] Re: Effect.Morph query

The code is being echoed in a php script (hence the $row and $class
variables but they do translate properly) I've pasted it below:

onclick=Effect.morph(lastPlayed , {'style: $class'}), $('$row
[TrackID]').morph('background:#ffcc33;'),var lastPlayed = ''$row
[TrackID]';

This is one of my many failed attempts.

Thanks for the help

Cheers
Andy

On Jul 30, 10:26 am, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Can you give an example of your code in a pastebin and i will ammend
 it
 to
 do what it needs to.

 Regards

 Alex 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

I would replace all of your code with the Ajax.Updater...

http://pastie.org/566564

I have put most of it into the pastie above You will want to check it 
and replace your code with it if you are happy.

Regards



Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 12:49 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



I've replaced the script with the new one but I'm struggling with the
syntax for including the initMorphing function. My AJAX request is
posted here:

http://pastie.org/566545

I've put the function where I think it should go but I'm not sure if
it's right, could you confirm?

Cheers
Andy

On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 You have a noticeable invalid spec on that pastie...

 The first is all of the buttons have the same id of clearButton
 Element id's should be unique.

 If you're loading the bits via ajax then you will need to clean up the old
 function and bind a new one each time the ajax is called.

 There are many ways to do this, i prefer wrapping the $$().invoke(
 part of the script in its own funciton and calling that either at the 
 bottom
 of the Ajax.Updater/Request or onSuccess.

 For garbage colleciton (unbinding the old binds and so on to keep a clean
 scope simply

 I have ammended the code and reposted it at

 http://pastie.org/566530

 I put in a self cleaning call into the funciton for you that will stop the
 observing and set the window.lastMorphed variable to null...

 This should keep the window scope clean and also remove the binding on
 elements that dont exist after an Ajax.Updater.

 You should call it in the 'onSuccess' part of your ajax

 something like

 onSuccess : function() {
 initMorphing();

 }

 HTH

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 12:13 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 I do have another question.

 The list of elements is loaded with ajax, I think it is properly
 formed for your script to work but it's here in case you want to
 check:

 http://pastie.org/566516

 I think I need to run your script after each AJAX reload of the data
 but I'm not sure how to achieve this, would the browser recognise the
 script is I echo it in the php output from the file running the query?

 Cheers
 Andy

 On Jul 31, 11:01 am, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You;re more than welcome

  That will give you he basis on how to do this kinda stuff without 
  onclick!

  Anything else just let me/the group know

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 10:59 AM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  Sorry, forgot to mention I was an idiot :)

  Thanks very much it works brilliantly

  On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Andy you completely disregarded the onclick notes i gave you and 
   mangled
   the
   script.

  http://pastie.org/566455

   That works completely fine... all you ahev to do is remve the
   script src=/resources/includes/client/shrunkpse.js
   type=text/javascript/script
   Block and put in your paths to prototype,scriptaculous,effects and it
   works
   how you want it to.

   HTH

   (stay away form onlick)!!

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 9:54 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Hi

   Thanks for the help, I tried the above in a clean page but I can't
   get it to work, the code as I've implemented it is here:

   script src='http://pastie.org/566433.js'/script

   Can you see where I've gone wrong (it's almost definately my fault) :)

   Cheers
   Andy

   On Jul 30, 11:03 am, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
A couple of things i would do.

First i would remove the onlick and assign the elements a classname
something like this will work

   http://pastie.org/565060

HTH

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Thursday, July 30, 2009 10:42 AM
Subject: [Proto-Scripty] Re: Effect.Morph query

The code is being echoed in a php script (hence the $row and $class
variables but they do translate properly) I've 

[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-31 Thread T.J. Crowder

Hi,

There are the documented supported browsers:
http://prototypejs.org/download

Using Prototype  script.aculo.us in earlier browsers will not be
_supported_, but whether it'll work is more a fuzzy gray than black
or white -- e.g., it will vary dramatically by feature.  I expect that
the $() function will work on quite a few older browsers, whereas I'd
be surprised if Element#getDimensions and some of the niftier things
script.aculo.us does with computed styles were reliable.

In terms of *language* features, I think you're pretty safe.
Prototype uses Function#apply, Function#call, the arguments array, and
the special behavior of the || (OR) operator, all of which were added
after the first couple of releases of the language, but it was a
looong time ago.  In fact, just looked it up[1], and if Wikipedia is
correct we're talking 1998 or earlier for all of those.

Prototype may (or may not) use some of the new array features from
JavaScript 1.6 (~2005), but I suspect not (at least not 1.6.0.3) or
that it has emulations of them it'll use if they're not there.  If
there are any missing, though, it's easy enough to add emulations to
the array prototype, and in any case a quick scan through the source
for the new methods will tell you.

In terms of Ajax features, if you're talking Mozilla 1.7, that would
be well after Gecko had XmlHttpRequest.  Can't guarantee there won't
be niggles, but...

Bottom line is that it's unlikely to just work, but I suspect most
of what you'll hit will be manageable.  The joy is you have the
source, and the license is not forbidding.

[1] http://en.wikipedia.org/wiki/JavaScript#Versions

Good luck,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Jul 31, 9:09 am, Christophe Decaux christophe.dec...@gmail.com
wrote:
 That's right, it's device app dev.
 The device is a Cisco DMP 4300 series
 Does anyone knows what are the minimum browser requirements to run  
 Prototype and Scriptaculous
 Christophe

 Le 30 juil. 09 à 22:40, Rick Waldron a écrit :



  That sounds like fun... i like device app development. Can you tell  
  us what device you're working with? That will be helpful

  Rick

  On Thu, Jul 30, 2009 at 3:55 PM, Christophe christophe.dec...@gmail.com
   wrote:

  Hi there,

  Apologies to everybody if my question is offending in any way, but
  this is my first post to such a group.

  I'm a occasional user of Prototype and Scriptaculous and pretty happy
  with these tools.

  However, I'm facing an issue for which I can find any answer around:

  I created some pages that work pretty well on modern browsers such as
  FF 3 or 3.5 and Safari 3 or 4, but I'm asked to make them run on some
  special Internet devices that run only Mozilla Firefox 1.7 with
  Javascript 1.5

  So my question is : what are the requirements of Prototype 1.6 and
  Scriptaculous 1.8, will my pages run well on such an old browser.
  If not, is there an older version of Prototype and/or Scriptaculous
  that will answer my problem.

  Thanks in advance

  Christophe
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Newbee question : Compatibility with javascript 1.5

2009-07-31 Thread Christophe Decaux

TJ,
Thanks for spending time to compile all this stuff.
Looking forward to enjoy working with old browsers ;-) Just to realize  
how much time flies.
Christophe

Le 31 juil. 09 à 14:16, T.J. Crowder a écrit :


 Hi,

 There are the documented supported browsers:
 http://prototypejs.org/download

 Using Prototype  script.aculo.us in earlier browsers will not be
 _supported_, but whether it'll work is more a fuzzy gray than black
 or white -- e.g., it will vary dramatically by feature.  I expect that
 the $() function will work on quite a few older browsers, whereas I'd
 be surprised if Element#getDimensions and some of the niftier things
 script.aculo.us does with computed styles were reliable.

 In terms of *language* features, I think you're pretty safe.
 Prototype uses Function#apply, Function#call, the arguments array, and
 the special behavior of the || (OR) operator, all of which were added
 after the first couple of releases of the language, but it was a
 looong time ago.  In fact, just looked it up[1], and if Wikipedia is
 correct we're talking 1998 or earlier for all of those.

 Prototype may (or may not) use some of the new array features from
 JavaScript 1.6 (~2005), but I suspect not (at least not 1.6.0.3) or
 that it has emulations of them it'll use if they're not there.  If
 there are any missing, though, it's easy enough to add emulations to
 the array prototype, and in any case a quick scan through the source
 for the new methods will tell you.

 In terms of Ajax features, if you're talking Mozilla 1.7, that would
 be well after Gecko had XmlHttpRequest.  Can't guarantee there won't
 be niggles, but...

 Bottom line is that it's unlikely to just work, but I suspect most
 of what you'll hit will be manageable.  The joy is you have the
 source, and the license is not forbidding.

 [1] http://en.wikipedia.org/wiki/JavaScript#Versions

 Good luck,
 --
 T.J. Crowder
 tj / crowder software / com
 Independent Software Engineer, consulting services available


 On Jul 31, 9:09 am, Christophe Decaux christophe.dec...@gmail.com
 wrote:
 That's right, it's device app dev.
 The device is a Cisco DMP 4300 series
 Does anyone knows what are the minimum browser requirements to run
 Prototype and Scriptaculous
 Christophe

 Le 30 juil. 09 à 22:40, Rick Waldron a écrit :



 That sounds like fun... i like device app development. Can you tell
 us what device you're working with? That will be helpful

 Rick

 On Thu, Jul 30, 2009 at 3:55 PM, Christophe  
 christophe.dec...@gmail.com
 wrote:

 Hi there,

 Apologies to everybody if my question is offending in any way, but
 this is my first post to such a group.

 I'm a occasional user of Prototype and Scriptaculous and pretty  
 happy
 with these tools.

 However, I'm facing an issue for which I can find any answer around:

 I created some pages that work pretty well on modern browsers such  
 as
 FF 3 or 3.5 and Safari 3 or 4, but I'm asked to make them run on  
 some
 special Internet devices that run only Mozilla Firefox 1.7 with
 Javascript 1.5

 So my question is : what are the requirements of Prototype 1.6 and
 Scriptaculous 1.8, will my pages run well on such an old browser.
 If not, is there an older version of Prototype and/or Scriptaculous
 that will answer my problem.

 Thanks in advance

 Christophe
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Eventchain click and drag

2009-07-31 Thread ferion

I want to bind two events on one object.
One of them ist the Drag Event provided by the Draggable Object
The other ist a click event simply attached by Event.observe

Problem is, the IE ignores the click Event and fires everytime the
Drag event.

Qestion:
How do i convince the IE to fire a click if the user isn't dragging.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

Wicked.

I've edited it and think it's ok. the params are being passed as null
though. Here is your revised ajaxFunction as I've implemented it:

http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating in\includes\functions\trackQuery.php
on line 7

Notice: Undefined index: Commerciality in\functions\trackQuery.php on
line 8

Notice: Undefined index: SearchID in includes\functions\trackQuery.php
on line 9

Any idea why this might be happening, it worked with the old
ajaxFunction.

Cheers
Andy

On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I would replace all of your code with the Ajax.Updater...

 http://pastie.org/566564

 I have put most of it into the pastie above You will want to check it
 and replace your code with it if you are happy.

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 12:49 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 I've replaced the script with the new one but I'm struggling with the
 syntax for including the initMorphing function. My AJAX request is
 posted here:

 http://pastie.org/566545

 I've put the function where I think it should go but I'm not sure if
 it's right, could you confirm?

 Cheers
 Andy

 On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You have a noticeable invalid spec on that pastie...

  The first is all of the buttons have the same id of clearButton
  Element id's should be unique.

  If you're loading the bits via ajax then you will need to clean up the old
  function and bind a new one each time the ajax is called.

  There are many ways to do this, i prefer wrapping the $$().invoke(
  part of the script in its own funciton and calling that either at the
  bottom
  of the Ajax.Updater/Request or onSuccess.

  For garbage colleciton (unbinding the old binds and so on to keep a clean
  scope simply

  I have ammended the code and reposted it at

 http://pastie.org/566530

  I put in a self cleaning call into the funciton for you that will stop the
  observing and set the window.lastMorphed variable to null...

  This should keep the window scope clean and also remove the binding on
  elements that dont exist after an Ajax.Updater.

  You should call it in the 'onSuccess' part of your ajax

  something like

  onSuccess : function() {
  initMorphing();

  }

  HTH

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 12:13 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I do have another question.

  The list of elements is loaded with ajax, I think it is properly
  formed for your script to work but it's here in case you want to
  check:

 http://pastie.org/566516

  I think I need to run your script after each AJAX reload of the data
  but I'm not sure how to achieve this, would the browser recognise the
  script is I echo it in the php output from the file running the query?

  Cheers
  Andy

  On Jul 31, 11:01 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   You;re more than welcome

   That will give you he basis on how to do this kinda stuff without
   onclick!

   Anything else just let me/the group know

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 10:59 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Sorry, forgot to mention I was an idiot :)

   Thanks very much it works brilliantly

   On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
Andy you completely disregarded the onclick notes i gave you and
mangled
the
script.

   http://pastie.org/566455

That works completely fine... all you ahev to do is remve the
script src=/resources/includes/client/shrunkpse.js
type=text/javascript/script
Block and put in your paths to prototype,scriptaculous,effects and it
works
how you want it to.

HTH

(stay away form onlick)!!

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 9:54 AM
Subject: [Proto-Scripty] Re: Effect.Morph query

Hi

Thanks for the help, I tried the above in a clean page but I can't
get it to work, the code as 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

its not Request=null its request=null as the object is assigned to 
request at var request=new Ajax
You should pastebin your whole page it is being called on so i can see why 
the elements are null ... they are taken direct from your code and $() is 
merely a shortcut for document.getElementById()...




Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:26 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



Wicked.

I've edited it and think it's ok. the params are being passed as null
though. Here is your revised ajaxFunction as I've implemented it:

http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating in\includes\functions\trackQuery.php
on line 7

Notice: Undefined index: Commerciality in\functions\trackQuery.php on
line 8

Notice: Undefined index: SearchID in includes\functions\trackQuery.php
on line 9

Any idea why this might be happening, it worked with the old
ajaxFunction.

Cheers
Andy

On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I would replace all of your code with the Ajax.Updater...

 http://pastie.org/566564

 I have put most of it into the pastie above You will want to check it
 and replace your code with it if you are happy.

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 12:49 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 I've replaced the script with the new one but I'm struggling with the
 syntax for including the initMorphing function. My AJAX request is
 posted here:

 http://pastie.org/566545

 I've put the function where I think it should go but I'm not sure if
 it's right, could you confirm?

 Cheers
 Andy

 On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You have a noticeable invalid spec on that pastie...

  The first is all of the buttons have the same id of clearButton
  Element id's should be unique.

  If you're loading the bits via ajax then you will need to clean up the 
  old
  function and bind a new one each time the ajax is called.

  There are many ways to do this, i prefer wrapping the 
  $$().invoke(
  part of the script in its own funciton and calling that either at the
  bottom
  of the Ajax.Updater/Request or onSuccess.

  For garbage colleciton (unbinding the old binds and so on to keep a 
  clean
  scope simply

  I have ammended the code and reposted it at

 http://pastie.org/566530

  I put in a self cleaning call into the funciton for you that will stop 
  the
  observing and set the window.lastMorphed variable to null...

  This should keep the window scope clean and also remove the binding on
  elements that dont exist after an Ajax.Updater.

  You should call it in the 'onSuccess' part of your ajax

  something like

  onSuccess : function() {
  initMorphing();

  }

  HTH

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 12:13 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I do have another question.

  The list of elements is loaded with ajax, I think it is properly
  formed for your script to work but it's here in case you want to
  check:

 http://pastie.org/566516

  I think I need to run your script after each AJAX reload of the data
  but I'm not sure how to achieve this, would the browser recognise the
  script is I echo it in the php output from the file running the query?

  Cheers
  Andy

  On Jul 31, 11:01 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   You;re more than welcome

   That will give you he basis on how to do this kinda stuff without
   onclick!

   Anything else just let me/the group know

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 10:59 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Sorry, forgot to mention I was an idiot :)

   Thanks very much it works brilliantly

   On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
Andy you completely disregarded the onclick notes i gave you and
mangled
the
script.

   http://pastie.org/566455

That works completely fine... all you ahev to do is remve the
script 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

Wicked.

I've edited it and think it's ok. the params are being passed as null
though. Here is your revised ajaxFunction as I've implemented it:

http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating in\includes\functions\trackQuery.php
on line 7

Notice: Undefined index: Commerciality in\functions\trackQuery.php on
line 8

Notice: Undefined index: SearchID in includes\functions\trackQuery.php
on line 9

Any idea why this might be happening, it worked with the old
ajaxFunction.

Cheers
Andy

On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I would replace all of your code with the Ajax.Updater...

 http://pastie.org/566564

 I have put most of it into the pastie above You will want to check it
 and replace your code with it if you are happy.

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 12:49 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 I've replaced the script with the new one but I'm struggling with the
 syntax for including the initMorphing function. My AJAX request is
 posted here:

 http://pastie.org/566545

 I've put the function where I think it should go but I'm not sure if
 it's right, could you confirm?

 Cheers
 Andy

 On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You have a noticeable invalid spec on that pastie...

  The first is all of the buttons have the same id of clearButton
  Element id's should be unique.

  If you're loading the bits via ajax then you will need to clean up the old
  function and bind a new one each time the ajax is called.

  There are many ways to do this, i prefer wrapping the $$().invoke(
  part of the script in its own funciton and calling that either at the
  bottom
  of the Ajax.Updater/Request or onSuccess.

  For garbage colleciton (unbinding the old binds and so on to keep a clean
  scope simply

  I have ammended the code and reposted it at

 http://pastie.org/566530

  I put in a self cleaning call into the funciton for you that will stop the
  observing and set the window.lastMorphed variable to null...

  This should keep the window scope clean and also remove the binding on
  elements that dont exist after an Ajax.Updater.

  You should call it in the 'onSuccess' part of your ajax

  something like

  onSuccess : function() {
  initMorphing();

  }

  HTH

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 12:13 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I do have another question.

  The list of elements is loaded with ajax, I think it is properly
  formed for your script to work but it's here in case you want to
  check:

 http://pastie.org/566516

  I think I need to run your script after each AJAX reload of the data
  but I'm not sure how to achieve this, would the browser recognise the
  script is I echo it in the php output from the file running the query?

  Cheers
  Andy

  On Jul 31, 11:01 am, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   You;re more than welcome

   That will give you he basis on how to do this kinda stuff without
   onclick!

   Anything else just let me/the group know

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 10:59 AM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Sorry, forgot to mention I was an idiot :)

   Thanks very much it works brilliantly

   On Jul 31, 10:39 am, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
Andy you completely disregarded the onclick notes i gave you and
mangled
the
script.

   http://pastie.org/566455

That works completely fine... all you ahev to do is remve the
script src=/resources/includes/client/shrunkpse.js
type=text/javascript/script
Block and put in your paths to prototype,scriptaculous,effects and it
works
how you want it to.

HTH

(stay away form onlick)!!

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 9:54 AM
Subject: [Proto-Scripty] Re: Effect.Morph query

Hi

Thanks for the help, I tried the above in a clean page but I can't
get it to work, the code as 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

The values are taken from a few diferrent places but Melody, Rating,
Production and Commerciality are taken from Scriptaculous sliders (so
just a hidden input value)

The code from the page is:

input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

input type='hidden' id='Commerciality' value=\ .
$COMMERCIALITY_VAL . \/

each of those php variables are currently set to:

$MELODY_VAL = 0;
$RATING_VAL = 0;
$PRODUCTION_VAL =0;
$COMMERCIALITY_VAL = 0;

as all the sliders begin at 0.

Firebug console is reporting the GET request to trackquery but it
doesn't have any parameters on the end.

Cheers
Andy

On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 its not Request=null its request=null as the object is assigned to
 request at var request=new Ajax
 You should pastebin your whole page it is being called on so i can see why
 the elements are null ... they are taken direct from your code and $() is
 merely a shortcut for document.getElementById()...

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 2:26 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Wicked.

 I've edited it and think it's ok. the params are being passed as null
 though. Here is your revised ajaxFunction as I've implemented it:

 http://pastie.org/566649

 But the response I get back is:

 Notice: Undefined index: Melody in includes\functions\trackQuery.php
 on line 5

 Notice: Undefined index: Production in includes\functions
 \trackQuery.php on line 6

 Notice: Undefined index: Rating in\includes\functions\trackQuery.php
 on line 7

 Notice: Undefined index: Commerciality in\functions\trackQuery.php on
 line 8

 Notice: Undefined index: SearchID in includes\functions\trackQuery.php
 on line 9

 Any idea why this might be happening, it worked with the old
 ajaxFunction.

 Cheers
 Andy

 On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  I would replace all of your code with the Ajax.Updater...

 http://pastie.org/566564

  I have put most of it into the pastie above You will want to check it
  and replace your code with it if you are happy.

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 12:49 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I've replaced the script with the new one but I'm struggling with the
  syntax for including the initMorphing function. My AJAX request is
  posted here:

 http://pastie.org/566545

  I've put the function where I think it should go but I'm not sure if
  it's right, could you confirm?

  Cheers
  Andy

  On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   You have a noticeable invalid spec on that pastie...

   The first is all of the buttons have the same id of clearButton
   Element id's should be unique.

   If you're loading the bits via ajax then you will need to clean up the
   old
   function and bind a new one each time the ajax is called.

   There are many ways to do this, i prefer wrapping the
   $$().invoke(
   part of the script in its own funciton and calling that either at the
   bottom
   of the Ajax.Updater/Request or onSuccess.

   For garbage colleciton (unbinding the old binds and so on to keep a
   clean
   scope simply

   I have ammended the code and reposted it at

  http://pastie.org/566530

   I put in a self cleaning call into the funciton for you that will stop
   the
   observing and set the window.lastMorphed variable to null...

   This should keep the window scope clean and also remove the binding on
   elements that dont exist after an Ajax.Updater.

   You should call it in the 'onSuccess' part of your ajax

   something like

   onSuccess : function() {
   initMorphing();

   }

   HTH

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 12:13 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   I do have another question.

   The list of elements is loaded with ajax, I think it is properly
   formed for your script to work but it's here in case you want to
   check:

  http://pastie.org/566516

   I think I need to run your script after each AJAX reload of the data
   but I'm not sure how to achieve this, would the browser recognise the
   script is I echo it in the php output from the file running the query?

   Cheers
   Andy

   On Jul 31, 11:01 am, Alex McAuley 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

Sorry ANdy

Adjust the code form params : {}

 to

parameters

Typo - My mistake.

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:41 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



The values are taken from a few diferrent places but Melody, Rating,
Production and Commerciality are taken from Scriptaculous sliders (so
just a hidden input value)

The code from the page is:

input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

input type='hidden' id='Commerciality' value=\ .
$COMMERCIALITY_VAL . \/

each of those php variables are currently set to:

$MELODY_VAL = 0;
$RATING_VAL = 0;
$PRODUCTION_VAL =0;
$COMMERCIALITY_VAL = 0;

as all the sliders begin at 0.

Firebug console is reporting the GET request to trackquery but it
doesn't have any parameters on the end.

Cheers
Andy

On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 its not Request=null its request=null as the object is assigned to
 request at var request=new Ajax
 You should pastebin your whole page it is being called on so i can see why
 the elements are null ... they are taken direct from your code and $() is
 merely a shortcut for document.getElementById()...

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 2:26 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Wicked.

 I've edited it and think it's ok. the params are being passed as null
 though. Here is your revised ajaxFunction as I've implemented it:

 http://pastie.org/566649

 But the response I get back is:

 Notice: Undefined index: Melody in includes\functions\trackQuery.php
 on line 5

 Notice: Undefined index: Production in includes\functions
 \trackQuery.php on line 6

 Notice: Undefined index: Rating in\includes\functions\trackQuery.php
 on line 7

 Notice: Undefined index: Commerciality in\functions\trackQuery.php on
 line 8

 Notice: Undefined index: SearchID in includes\functions\trackQuery.php
 on line 9

 Any idea why this might be happening, it worked with the old
 ajaxFunction.

 Cheers
 Andy

 On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  I would replace all of your code with the Ajax.Updater...

 http://pastie.org/566564

  I have put most of it into the pastie above You will want to check 
  it
  and replace your code with it if you are happy.

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 12:49 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I've replaced the script with the new one but I'm struggling with the
  syntax for including the initMorphing function. My AJAX request is
  posted here:

 http://pastie.org/566545

  I've put the function where I think it should go but I'm not sure if
  it's right, could you confirm?

  Cheers
  Andy

  On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   You have a noticeable invalid spec on that pastie...

   The first is all of the buttons have the same id of clearButton
   Element id's should be unique.

   If you're loading the bits via ajax then you will need to clean up the
   old
   function and bind a new one each time the ajax is called.

   There are many ways to do this, i prefer wrapping the
   $$().invoke(
   part of the script in its own funciton and calling that either at the
   bottom
   of the Ajax.Updater/Request or onSuccess.

   For garbage colleciton (unbinding the old binds and so on to keep a
   clean
   scope simply

   I have ammended the code and reposted it at

  http://pastie.org/566530

   I put in a self cleaning call into the funciton for you that will stop
   the
   observing and set the window.lastMorphed variable to null...

   This should keep the window scope clean and also remove the binding on
   elements that dont exist after an Ajax.Updater.

   You should call it in the 'onSuccess' part of your ajax

   something like

   onSuccess : function() {
   initMorphing();

   }

   HTH

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 12:13 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   I do have another question.

   The list of elements is loaded with ajax, I think it is properly
   formed for your script to work but it's 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

In that i mean

Change params to parameters ... incase that made no sense!!


Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Alex McAuley webmas...@thecarmarketplace.com
To: prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 3:08 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



Sorry ANdy

Adjust the code form params : {}

 to

parameters

Typo - My mistake.

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:41 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



The values are taken from a few diferrent places but Melody, Rating,
Production and Commerciality are taken from Scriptaculous sliders (so
just a hidden input value)

The code from the page is:

input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

input type='hidden' id='Commerciality' value=\ .
$COMMERCIALITY_VAL . \/

each of those php variables are currently set to:

$MELODY_VAL = 0;
$RATING_VAL = 0;
$PRODUCTION_VAL =0;
$COMMERCIALITY_VAL = 0;

as all the sliders begin at 0.

Firebug console is reporting the GET request to trackquery but it
doesn't have any parameters on the end.

Cheers
Andy

On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 its not Request=null its request=null as the object is assigned to
 request at var request=new Ajax
 You should pastebin your whole page it is being called on so i can see why
 the elements are null ... they are taken direct from your code and $() is
 merely a shortcut for document.getElementById()...

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 2:26 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Wicked.

 I've edited it and think it's ok. the params are being passed as null
 though. Here is your revised ajaxFunction as I've implemented it:

 http://pastie.org/566649

 But the response I get back is:

 Notice: Undefined index: Melody in includes\functions\trackQuery.php
 on line 5

 Notice: Undefined index: Production in includes\functions
 \trackQuery.php on line 6

 Notice: Undefined index: Rating in\includes\functions\trackQuery.php
 on line 7

 Notice: Undefined index: Commerciality in\functions\trackQuery.php on
 line 8

 Notice: Undefined index: SearchID in includes\functions\trackQuery.php
 on line 9

 Any idea why this might be happening, it worked with the old
 ajaxFunction.

 Cheers
 Andy

 On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  I would replace all of your code with the Ajax.Updater...

 http://pastie.org/566564

  I have put most of it into the pastie above You will want to check
  it
  and replace your code with it if you are happy.

  Regards

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 12:49 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  I've replaced the script with the new one but I'm struggling with the
  syntax for including the initMorphing function. My AJAX request is
  posted here:

 http://pastie.org/566545

  I've put the function where I think it should go but I'm not sure if
  it's right, could you confirm?

  Cheers
  Andy

  On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   You have a noticeable invalid spec on that pastie...

   The first is all of the buttons have the same id of clearButton
   Element id's should be unique.

   If you're loading the bits via ajax then you will need to clean up the
   old
   function and bind a new one each time the ajax is called.

   There are many ways to do this, i prefer wrapping the
   $$().invoke(
   part of the script in its own funciton and calling that either at the
   bottom
   of the Ajax.Updater/Request or onSuccess.

   For garbage colleciton (unbinding the old binds and so on to keep a
   clean
   scope simply

   I have ammended the code and reposted it at

  http://pastie.org/566530

   I put in a self cleaning call into the funciton for you that will stop
   the
   observing and set the window.lastMorphed variable to null...

   This should keep the window scope clean and also remove the binding on
   elements that dont exist after an Ajax.Updater.

   You should call it in the 'onSuccess' part of your ajax

   something like

   onSuccess : function() {
   initMorphing();

   }

   HTH

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

No need to apologise, you're already being far more helpful than I
ever thought possible, I'm even learning stuff :)

The request is working now but sadly the morph effect isn't. I've
posted all the relevant stuff below:

Including the initMorph function:

script src=?php echo DIR_JS;?prototype.js type=text/
javascript/script
script src=?php echo DIR_JS;?protoload.js type=text/
javascript/script
script src=?php echo DIR_JS;?slider.js type=text/javascript/
script
script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
script
script src=?php echo DIR_JS;?swfobject.js type=text/
JavaScript/script
script src=?php echo DIR_JS;?morphable.js type=text/
JavaScript/script //this one
script src=?php echo DIR_JS;?ajaxFunction.js type=text/
JavaScript/script

morphable.js:

http://pastie.org/566774

The bit of the php file that responds to the ajax request:

http://pastie.org/566781

And finally, the html output from that query:

http://pastie.org/566782

Cheers
Andy

On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Sorry ANdy

 Adjust the code form params : {}

  to

 parameters

 Typo - My mistake.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 2:41 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 The values are taken from a few diferrent places but Melody, Rating,
 Production and Commerciality are taken from Scriptaculous sliders (so
 just a hidden input value)

 The code from the page is:

 input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
 input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
 input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

 input type='hidden' id='Commerciality' value=\ .
 $COMMERCIALITY_VAL . \/

 each of those php variables are currently set to:

 $MELODY_VAL = 0;
 $RATING_VAL = 0;
 $PRODUCTION_VAL =0;
 $COMMERCIALITY_VAL = 0;

 as all the sliders begin at 0.

 Firebug console is reporting the GET request to trackquery but it
 doesn't have any parameters on the end.

 Cheers
 Andy

 On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  its not Request=null its request=null as the object is assigned to
  request at var request=new Ajax
  You should pastebin your whole page it is being called on so i can see why
  the elements are null ... they are taken direct from your code and $() is
  merely a shortcut for document.getElementById()...

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 2:26 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  Wicked.

  I've edited it and think it's ok. the params are being passed as null
  though. Here is your revised ajaxFunction as I've implemented it:

 http://pastie.org/566649

  But the response I get back is:

  Notice: Undefined index: Melody in includes\functions\trackQuery.php
  on line 5

  Notice: Undefined index: Production in includes\functions
  \trackQuery.php on line 6

  Notice: Undefined index: Rating in\includes\functions\trackQuery.php
  on line 7

  Notice: Undefined index: Commerciality in\functions\trackQuery.php on
  line 8

  Notice: Undefined index: SearchID in includes\functions\trackQuery.php
  on line 9

  Any idea why this might be happening, it worked with the old
  ajaxFunction.

  Cheers
  Andy

  On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   I would replace all of your code with the Ajax.Updater...

  http://pastie.org/566564

   I have put most of it into the pastie above You will want to check
   it
   and replace your code with it if you are happy.

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 12:49 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   I've replaced the script with the new one but I'm struggling with the
   syntax for including the initMorphing function. My AJAX request is
   posted here:

  http://pastie.org/566545

   I've put the function where I think it should go but I'm not sure if
   it's right, could you confirm?

   Cheers
   Andy

   On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
You have a noticeable invalid spec on that pastie...

The first is all of the buttons have the same id of clearButton
Element id's should be unique.

If you're loading the bits via ajax then you will need to clean up the
old
function and bind a new one each time the ajax is called.

There are many ways to do this, i prefer wrapping the
$$().invoke(
part of the script in 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

You have the PHP echoing out class=morphable instead of class=morphable

.. try changing that and it may work.

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 4:04 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



No need to apologise, you're already being far more helpful than I
ever thought possible, I'm even learning stuff :)

The request is working now but sadly the morph effect isn't. I've
posted all the relevant stuff below:

Including the initMorph function:

script src=?php echo DIR_JS;?prototype.js type=text/
javascript/script
script src=?php echo DIR_JS;?protoload.js type=text/
javascript/script
script src=?php echo DIR_JS;?slider.js type=text/javascript/
script
script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
script
script src=?php echo DIR_JS;?swfobject.js type=text/
JavaScript/script
script src=?php echo DIR_JS;?morphable.js type=text/
JavaScript/script //this one
script src=?php echo DIR_JS;?ajaxFunction.js type=text/
JavaScript/script

morphable.js:

http://pastie.org/566774

The bit of the php file that responds to the ajax request:

http://pastie.org/566781

And finally, the html output from that query:

http://pastie.org/566782

Cheers
Andy

On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 Sorry ANdy

 Adjust the code form params : {}

 to

 parameters

 Typo - My mistake.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 2:41 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 The values are taken from a few diferrent places but Melody, Rating,
 Production and Commerciality are taken from Scriptaculous sliders (so
 just a hidden input value)

 The code from the page is:

 input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
 input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
 input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

 input type='hidden' id='Commerciality' value=\ .
 $COMMERCIALITY_VAL . \/

 each of those php variables are currently set to:

 $MELODY_VAL = 0;
 $RATING_VAL = 0;
 $PRODUCTION_VAL =0;
 $COMMERCIALITY_VAL = 0;

 as all the sliders begin at 0.

 Firebug console is reporting the GET request to trackquery but it
 doesn't have any parameters on the end.

 Cheers
 Andy

 On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  its not Request=null its request=null as the object is assigned to
  request at var request=new Ajax
  You should pastebin your whole page it is being called on so i can see 
  why
  the elements are null ... they are taken direct from your code and $() 
  is
  merely a shortcut for document.getElementById()...

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 2:26 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  Wicked.

  I've edited it and think it's ok. the params are being passed as null
  though. Here is your revised ajaxFunction as I've implemented it:

 http://pastie.org/566649

  But the response I get back is:

  Notice: Undefined index: Melody in includes\functions\trackQuery.php
  on line 5

  Notice: Undefined index: Production in includes\functions
  \trackQuery.php on line 6

  Notice: Undefined index: Rating in\includes\functions\trackQuery.php
  on line 7

  Notice: Undefined index: Commerciality in\functions\trackQuery.php on
  line 8

  Notice: Undefined index: SearchID in includes\functions\trackQuery.php
  on line 9

  Any idea why this might be happening, it worked with the old
  ajaxFunction.

  Cheers
  Andy

  On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   I would replace all of your code with the Ajax.Updater...

  http://pastie.org/566564

   I have put most of it into the pastie above You will want to check
   it
   and replace your code with it if you are happy.

   Regards

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 12:49 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   I've replaced the script with the new one but I'm struggling with the
   syntax for including the initMorphing function. My AJAX request is
   posted here:

  http://pastie.org/566545

   I've put the function where I think it should go but I'm not sure if
   it's right, could you confirm?

   Cheers
   Andy

   On Jul 31, 12:34 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
You have a noticeable 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

Changed tr class=$class id=\$row[TrackID]\
to tr class=\$class\ id=\$row[TrackID]\

but it still doesn't morph

On Jul 31, 4:11 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 You have the PHP echoing out class=morphable instead of class=morphable

 .. try changing that and it may work.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 4:04 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 No need to apologise, you're already being far more helpful than I
 ever thought possible, I'm even learning stuff :)

 The request is working now but sadly the morph effect isn't. I've
 posted all the relevant stuff below:

 Including the initMorph function:

 script src=?php echo DIR_JS;?prototype.js type=text/
 javascript/script
 script src=?php echo DIR_JS;?protoload.js type=text/
 javascript/script
 script src=?php echo DIR_JS;?slider.js type=text/javascript/
 script
 script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
 script
 script src=?php echo DIR_JS;?swfobject.js type=text/
 JavaScript/script
 script src=?php echo DIR_JS;?morphable.js type=text/
 JavaScript/script //this one
 script src=?php echo DIR_JS;?ajaxFunction.js type=text/
 JavaScript/script

 morphable.js:

 http://pastie.org/566774

 The bit of the php file that responds to the ajax request:

 http://pastie.org/566781

 And finally, the html output from that query:

 http://pastie.org/566782

 Cheers
 Andy

 On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Sorry ANdy

  Adjust the code form params : {}

  to

  parameters

  Typo - My mistake.

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 2:41 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  The values are taken from a few diferrent places but Melody, Rating,
  Production and Commerciality are taken from Scriptaculous sliders (so
  just a hidden input value)

  The code from the page is:

  input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
  input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
  input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

  input type='hidden' id='Commerciality' value=\ .
  $COMMERCIALITY_VAL . \/

  each of those php variables are currently set to:

  $MELODY_VAL = 0;
  $RATING_VAL = 0;
  $PRODUCTION_VAL =0;
  $COMMERCIALITY_VAL = 0;

  as all the sliders begin at 0.

  Firebug console is reporting the GET request to trackquery but it
  doesn't have any parameters on the end.

  Cheers
  Andy

  On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   its not Request=null its request=null as the object is assigned to
   request at var request=new Ajax
   You should pastebin your whole page it is being called on so i can see
   why
   the elements are null ... they are taken direct from your code and $()
   is
   merely a shortcut for document.getElementById()...

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 2:26 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Wicked.

   I've edited it and think it's ok. the params are being passed as null
   though. Here is your revised ajaxFunction as I've implemented it:

  http://pastie.org/566649

   But the response I get back is:

   Notice: Undefined index: Melody in includes\functions\trackQuery.php
   on line 5

   Notice: Undefined index: Production in includes\functions
   \trackQuery.php on line 6

   Notice: Undefined index: Rating in\includes\functions\trackQuery.php
   on line 7

   Notice: Undefined index: Commerciality in\functions\trackQuery.php on
   line 8

   Notice: Undefined index: SearchID in includes\functions\trackQuery.php
   on line 9

   Any idea why this might be happening, it worked with the old
   ajaxFunction.

   Cheers
   Andy

   On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
I would replace all of your code with the Ajax.Updater...

   http://pastie.org/566564

I have put most of it into the pastie above You will want to check
it
and replace your code with it if you are happy.

Regards

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 12:49 PM
Subject: [Proto-Scripty] Re: Effect.Morph query

I've replaced the script with the new one but I'm struggling with the
syntax for including the initMorphing function. 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

I'll consult the docs on morph to see if its compatible with TR's

Some effects are and some are not.

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 4:19 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



Changed tr class=$class id=\$row[TrackID]\
to tr class=\$class\ id=\$row[TrackID]\

but it still doesn't morph

On Jul 31, 4:11 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 You have the PHP echoing out class=morphable instead of class=morphable

 .. try changing that and it may work.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 4:04 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 No need to apologise, you're already being far more helpful than I
 ever thought possible, I'm even learning stuff :)

 The request is working now but sadly the morph effect isn't. I've
 posted all the relevant stuff below:

 Including the initMorph function:

 script src=?php echo DIR_JS;?prototype.js type=text/
 javascript/script
 script src=?php echo DIR_JS;?protoload.js type=text/
 javascript/script
 script src=?php echo DIR_JS;?slider.js type=text/javascript/
 script
 script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
 script
 script src=?php echo DIR_JS;?swfobject.js type=text/
 JavaScript/script
 script src=?php echo DIR_JS;?morphable.js type=text/
 JavaScript/script //this one
 script src=?php echo DIR_JS;?ajaxFunction.js type=text/
 JavaScript/script

 morphable.js:

 http://pastie.org/566774

 The bit of the php file that responds to the ajax request:

 http://pastie.org/566781

 And finally, the html output from that query:

 http://pastie.org/566782

 Cheers
 Andy

 On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  Sorry ANdy

  Adjust the code form params : {}

  to

  parameters

  Typo - My mistake.

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 2:41 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  The values are taken from a few diferrent places but Melody, Rating,
  Production and Commerciality are taken from Scriptaculous sliders (so
  just a hidden input value)

  The code from the page is:

  input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
  input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
  input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

  input type='hidden' id='Commerciality' value=\ .
  $COMMERCIALITY_VAL . \/

  each of those php variables are currently set to:

  $MELODY_VAL = 0;
  $RATING_VAL = 0;
  $PRODUCTION_VAL =0;
  $COMMERCIALITY_VAL = 0;

  as all the sliders begin at 0.

  Firebug console is reporting the GET request to trackquery but it
  doesn't have any parameters on the end.

  Cheers
  Andy

  On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   its not Request=null its request=null as the object is assigned to
   request at var request=new Ajax
   You should pastebin your whole page it is being called on so i can see
   why
   the elements are null ... they are taken direct from your code and $()
   is
   merely a shortcut for document.getElementById()...

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 2:26 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   Wicked.

   I've edited it and think it's ok. the params are being passed as null
   though. Here is your revised ajaxFunction as I've implemented it:

  http://pastie.org/566649

   But the response I get back is:

   Notice: Undefined index: Melody in includes\functions\trackQuery.php
   on line 5

   Notice: Undefined index: Production in includes\functions
   \trackQuery.php on line 6

   Notice: Undefined index: Rating in\includes\functions\trackQuery.php
   on line 7

   Notice: Undefined index: Commerciality in\functions\trackQuery.php on
   line 8

   Notice: Undefined index: SearchID in includes\functions\trackQuery.php
   on line 9

   Any idea why this might be happening, it worked with the old
   ajaxFunction.

   Cheers
   Andy

   On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
I would replace all of your code with the Ajax.Updater...

   http://pastie.org/566564

I have put most of it into the pastie above You will want to 
check
it
and replace your code with it if you are happy.

Regards

Alex 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

Sorry, it's initMorphing();  (my turn for a typo) and that highlights
the row but the previous selction doesn't turn off.

Cheers
Andy

On Jul 31, 4:19 pm, Andrew Dodd a...@slicethepie.com wrote:
 Changed tr class=$class id=\$row[TrackID]\
 to tr class=\$class\ id=\$row[TrackID]\

 but it still doesn't morph

 On Jul 31, 4:11 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:

  You have the PHP echoing out class=morphable instead of class=morphable

  .. try changing that and it may work.

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 4:04 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  No need to apologise, you're already being far more helpful than I
  ever thought possible, I'm even learning stuff :)

  The request is working now but sadly the morph effect isn't. I've
  posted all the relevant stuff below:

  Including the initMorph function:

  script src=?php echo DIR_JS;?prototype.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?protoload.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?slider.js type=text/javascript/
  script
  script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
  script
  script src=?php echo DIR_JS;?swfobject.js type=text/
  JavaScript/script
  script src=?php echo DIR_JS;?morphable.js type=text/
  JavaScript/script //this one
  script src=?php echo DIR_JS;?ajaxFunction.js type=text/
  JavaScript/script

  morphable.js:

 http://pastie.org/566774

  The bit of the php file that responds to the ajax request:

 http://pastie.org/566781

  And finally, the html output from that query:

 http://pastie.org/566782

  Cheers
  Andy

  On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Sorry ANdy

   Adjust the code form params : {}

   to

   parameters

   Typo - My mistake.

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 2:41 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   The values are taken from a few diferrent places but Melody, Rating,
   Production and Commerciality are taken from Scriptaculous sliders (so
   just a hidden input value)

   The code from the page is:

   input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
   input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
   input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

   input type='hidden' id='Commerciality' value=\ .
   $COMMERCIALITY_VAL . \/

   each of those php variables are currently set to:

   $MELODY_VAL = 0;
   $RATING_VAL = 0;
   $PRODUCTION_VAL =0;
   $COMMERCIALITY_VAL = 0;

   as all the sliders begin at 0.

   Firebug console is reporting the GET request to trackquery but it
   doesn't have any parameters on the end.

   Cheers
   Andy

   On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
its not Request=null its request=null as the object is assigned to
request at var request=new Ajax
You should pastebin your whole page it is being called on so i can see
why
the elements are null ... they are taken direct from your code and $()
is
merely a shortcut for document.getElementById()...

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:26 PM
Subject: [Proto-Scripty] Re: Effect.Morph query

Wicked.

I've edited it and think it's ok. the params are being passed as null
though. Here is your revised ajaxFunction as I've implemented it:

   http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating in\includes\functions\trackQuery.php
on line 7

Notice: Undefined index: Commerciality in\functions\trackQuery.php on
line 8

Notice: Undefined index: SearchID in includes\functions\trackQuery.php
on line 9

Any idea why this might be happening, it worked with the old
ajaxFunction.

Cheers
Andy

On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I would replace all of your code with the Ajax.Updater...

http://pastie.org/566564

 I have put most of it into the pastie above You will want to check
 it
 and replace your code with it if you are happy.

 Regards

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

Onlick is bad ...

Is it now in the Event.observe(window wrapper?


Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 4:28 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



Sorry, it's initMorphing();  (my turn for a typo) and that highlights
the row but the previous selction doesn't turn off.

Cheers
Andy

On Jul 31, 4:19 pm, Andrew Dodd a...@slicethepie.com wrote:
 Changed tr class=$class id=\$row[TrackID]\
 to tr class=\$class\ id=\$row[TrackID]\

 but it still doesn't morph

 On Jul 31, 4:11 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:

  You have the PHP echoing out class=morphable instead of 
  class=morphable

  .. try changing that and it may work.

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us 
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 4:04 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  No need to apologise, you're already being far more helpful than I
  ever thought possible, I'm even learning stuff :)

  The request is working now but sadly the morph effect isn't. I've
  posted all the relevant stuff below:

  Including the initMorph function:

  script src=?php echo DIR_JS;?prototype.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?protoload.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?slider.js type=text/javascript/
  script
  script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
  script
  script src=?php echo DIR_JS;?swfobject.js type=text/
  JavaScript/script
  script src=?php echo DIR_JS;?morphable.js type=text/
  JavaScript/script //this one
  script src=?php echo DIR_JS;?ajaxFunction.js type=text/
  JavaScript/script

  morphable.js:

 http://pastie.org/566774

  The bit of the php file that responds to the ajax request:

 http://pastie.org/566781

  And finally, the html output from that query:

 http://pastie.org/566782

  Cheers
  Andy

  On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Sorry ANdy

   Adjust the code form params : {}

   to

   parameters

   Typo - My mistake.

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 2:41 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   The values are taken from a few diferrent places but Melody, Rating,
   Production and Commerciality are taken from Scriptaculous sliders (so
   just a hidden input value)

   The code from the page is:

   input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
   input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
   input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . 
   \/

   input type='hidden' id='Commerciality' value=\ .
   $COMMERCIALITY_VAL . \/

   each of those php variables are currently set to:

   $MELODY_VAL = 0;
   $RATING_VAL = 0;
   $PRODUCTION_VAL =0;
   $COMMERCIALITY_VAL = 0;

   as all the sliders begin at 0.

   Firebug console is reporting the GET request to trackquery but it
   doesn't have any parameters on the end.

   Cheers
   Andy

   On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
its not Request=null its request=null as the object is assigned to
request at var request=new Ajax
You should pastebin your whole page it is being called on so i can 
see
why
the elements are null ... they are taken direct from your code and 
$()
is
merely a shortcut for document.getElementById()...

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:26 PM
Subject: [Proto-Scripty] Re: Effect.Morph query

Wicked.

I've edited it and think it's ok. the params are being passed as 
null
though. Here is your revised ajaxFunction as I've implemented it:

   http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating in\includes\functions\trackQuery.php
on line 7

Notice: Undefined index: Commerciality in\functions\trackQuery.php 
on
line 8

Notice: Undefined index: SearchID in 
includes\functions\trackQuery.php
on line 9

Any idea why this might be happening, it worked with the old
ajaxFunction.

Cheers
Andy

On Jul 31, 1:02 pm, Alex McAuley 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Andrew Dodd

I think it is because when I was using it with onClick it did
highlight the row.

On Jul 31, 4:26 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I'll consult the docs on morph to see if its compatible with TR's

 Some effects are and some are not.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 4:19 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Changed tr class=$class id=\$row[TrackID]\
 to tr class=\$class\ id=\$row[TrackID]\

 but it still doesn't morph

 On Jul 31, 4:11 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You have the PHP echoing out class=morphable instead of class=morphable

  .. try changing that and it may work.

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 4:04 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  No need to apologise, you're already being far more helpful than I
  ever thought possible, I'm even learning stuff :)

  The request is working now but sadly the morph effect isn't. I've
  posted all the relevant stuff below:

  Including the initMorph function:

  script src=?php echo DIR_JS;?prototype.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?protoload.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?slider.js type=text/javascript/
  script
  script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
  script
  script src=?php echo DIR_JS;?swfobject.js type=text/
  JavaScript/script
  script src=?php echo DIR_JS;?morphable.js type=text/
  JavaScript/script //this one
  script src=?php echo DIR_JS;?ajaxFunction.js type=text/
  JavaScript/script

  morphable.js:

 http://pastie.org/566774

  The bit of the php file that responds to the ajax request:

 http://pastie.org/566781

  And finally, the html output from that query:

 http://pastie.org/566782

  Cheers
  Andy

  On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Sorry ANdy

   Adjust the code form params : {}

   to

   parameters

   Typo - My mistake.

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 2:41 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   The values are taken from a few diferrent places but Melody, Rating,
   Production and Commerciality are taken from Scriptaculous sliders (so
   just a hidden input value)

   The code from the page is:

   input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
   input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
   input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . \/

   input type='hidden' id='Commerciality' value=\ .
   $COMMERCIALITY_VAL . \/

   each of those php variables are currently set to:

   $MELODY_VAL = 0;
   $RATING_VAL = 0;
   $PRODUCTION_VAL =0;
   $COMMERCIALITY_VAL = 0;

   as all the sliders begin at 0.

   Firebug console is reporting the GET request to trackquery but it
   doesn't have any parameters on the end.

   Cheers
   Andy

   On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
its not Request=null its request=null as the object is assigned to
request at var request=new Ajax
You should pastebin your whole page it is being called on so i can see
why
the elements are null ... they are taken direct from your code and $()
is
merely a shortcut for document.getElementById()...

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:26 PM
Subject: [Proto-Scripty] Re: Effect.Morph query

Wicked.

I've edited it and think it's ok. the params are being passed as null
though. Here is your revised ajaxFunction as I've implemented it:

   http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating in\includes\functions\trackQuery.php
on line 7

Notice: Undefined index: Commerciality in\functions\trackQuery.php on
line 8

Notice: Undefined index: SearchID in includes\functions\trackQuery.php
on line 9

Any idea why this might be happening, it worked with the old
ajaxFunction.

Cheers
Andy

On Jul 31, 1:02 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I would replace 

[Proto-Scripty] Re: Effect.Morph query

2009-07-31 Thread Alex McAuley

http://pastie.org/566774

you have a line ...

$(elem).morph('oddrow');Which will not work as oddrow is not a style.

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 4:37 PM
Subject: [Proto-Scripty] Re: Effect.Morph query



I think it is because when I was using it with onClick it did
highlight the row.

On Jul 31, 4:26 pm, Alex McAuley webmas...@thecarmarketplace.com
wrote:
 I'll consult the docs on morph to see if its compatible with TR's

 Some effects are and some are not.

 Alex Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Andrew Dodd a...@slicethepie.com
 To: Prototype  script.aculo.us 
 prototype-scriptaculous@googlegroups.com
 Sent: Friday, July 31, 2009 4:19 PM
 Subject: [Proto-Scripty] Re: Effect.Morph query

 Changed tr class=$class id=\$row[TrackID]\
 to tr class=\$class\ id=\$row[TrackID]\

 but it still doesn't morph

 On Jul 31, 4:11 pm, Alex McAuley webmas...@thecarmarketplace.com
 wrote:
  You have the PHP echoing out class=morphable instead of 
  class=morphable

  .. try changing that and it may work.

  Alex Mcauleyhttp://www.thevacancymarket.com

  - Original Message -
  From: Andrew Dodd a...@slicethepie.com
  To: Prototype  script.aculo.us
  prototype-scriptaculous@googlegroups.com
  Sent: Friday, July 31, 2009 4:04 PM
  Subject: [Proto-Scripty] Re: Effect.Morph query

  No need to apologise, you're already being far more helpful than I
  ever thought possible, I'm even learning stuff :)

  The request is working now but sadly the morph effect isn't. I've
  posted all the relevant stuff below:

  Including the initMorph function:

  script src=?php echo DIR_JS;?prototype.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?protoload.js type=text/
  javascript/script
  script src=?php echo DIR_JS;?slider.js type=text/javascript/
  script
  script src=?php echo DIR_JS;?effects.js type=text/JavaScript/
  script
  script src=?php echo DIR_JS;?swfobject.js type=text/
  JavaScript/script
  script src=?php echo DIR_JS;?morphable.js type=text/
  JavaScript/script //this one
  script src=?php echo DIR_JS;?ajaxFunction.js type=text/
  JavaScript/script

  morphable.js:

 http://pastie.org/566774

  The bit of the php file that responds to the ajax request:

 http://pastie.org/566781

  And finally, the html output from that query:

 http://pastie.org/566782

  Cheers
  Andy

  On Jul 31, 3:08 pm, Alex McAuley webmas...@thecarmarketplace.com
  wrote:
   Sorry ANdy

   Adjust the code form params : {}

   to

   parameters

   Typo - My mistake.

   Alex Mcauleyhttp://www.thevacancymarket.com

   - Original Message -
   From: Andrew Dodd a...@slicethepie.com
   To: Prototype  script.aculo.us
   prototype-scriptaculous@googlegroups.com
   Sent: Friday, July 31, 2009 2:41 PM
   Subject: [Proto-Scripty] Re: Effect.Morph query

   The values are taken from a few diferrent places but Melody, Rating,
   Production and Commerciality are taken from Scriptaculous sliders (so
   just a hidden input value)

   The code from the page is:

   input type='hidden' id='Melody' value=\ . $MELODY_VAL . \/
   input type='hidden' id='Rating' value=\ . $RATING_VAL . \/
   input type='hidden' id='Production' value=\ . $PRODUCTION_VAL . 
   \/

   input type='hidden' id='Commerciality' value=\ .
   $COMMERCIALITY_VAL . \/

   each of those php variables are currently set to:

   $MELODY_VAL = 0;
   $RATING_VAL = 0;
   $PRODUCTION_VAL =0;
   $COMMERCIALITY_VAL = 0;

   as all the sliders begin at 0.

   Firebug console is reporting the GET request to trackquery but it
   doesn't have any parameters on the end.

   Cheers
   Andy

   On Jul 31, 2:32 pm, Alex McAuley webmas...@thecarmarketplace.com
   wrote:
its not Request=null its request=null as the object is assigned to
request at var request=new Ajax
You should pastebin your whole page it is being called on so i can 
see
why
the elements are null ... they are taken direct from your code and 
$()
is
merely a shortcut for document.getElementById()...

Alex Mcauleyhttp://www.thevacancymarket.com

- Original Message -
From: Andrew Dodd a...@slicethepie.com
To: Prototype  script.aculo.us
prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 2:26 PM
Subject: [Proto-Scripty] Re: Effect.Morph query

Wicked.

I've edited it and think it's ok. the params are being passed as 
null
though. Here is your revised ajaxFunction as I've implemented it:

   http://pastie.org/566649

But the response I get back is:

Notice: Undefined index: Melody in includes\functions\trackQuery.php
on line 5

Notice: Undefined index: Production in includes\functions
\trackQuery.php on line 6

Notice: Undefined index: Rating 

[Proto-Scripty] Re: Escaping Input

2009-07-31 Thread infringer

This method works well in FF 3.5, but FF 3.0.12 doesn't like it...  I
really would like to keep the from coming in a separate variable, but
realize I may have to change that.

3.0.12's POST (truncated) just for info:
%7Bstartdate%3A%202009-04-23%2C%20

3.5's POST (truncated):
%7B%22startdate%22%3A%20%222009-04-23%22%2C%


As you can see 3.5 has extra characters...

I'm sending this to PHP, and my processing script receives the JSON
variable as such

$json_string = (isset($_POST['json']) ? rawurldecode($_POST['json']) :
);
$json = json_decode($json_string, true);
if (($json == '') || empty($json) || ($json == null)) {
$result['valid_result'] = 2;
$result['reason'] = rawurlencode(Unknown error, Administrator has
been notified.  Please try again later);
$result = json_encode($result);
header(Content-Type: application/json);
print $result;
exit(0);

}

so when users are using 3.0.xx they always receive this error message,
because the PHP script doesn't see it as valid JSON.

but 3.5 users (myself only) can perform the saves/deletes, etc

This is for an internal application, we only allow FF to be used.

Thanks for the help!
-David


On Jul 30, 4:00 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Sorry, I got my wires crossed half-way through the first one of
 those.  You can't use String#toJSON, it's not a string!  Doh.
 Correcting my first example:

 entry = encodeURIComponent(Object.toJSON($('busCalForm').serialize
 (true)));
 new Ajax.Request(
     modules/buscal/processes/saveBooking.php, {
     parameters: {
         year: year,
         recnum: busmstr_id,
         json: entry
     },
     onSuccess: busCal.gotEntry.bind(this),
     onFailure: busCal.gotFailure.bind(this)

 });

 Sorry 'bout that.

 -- T.J. :-)

 On Jul 30, 8:55 pm, T.J. Crowder t...@crowdersoftware.com wrote:



  Hi,

  You're sending an unencoded string (which happens to be in JSON
  format) as part of your parameters string, which is meant to be URL-
  encoded data.  A # sign is the least of your problems. ;-)  You'll
  want to encode that with JavaScript's encodeURIComponent function[1].

  Somewhat OT, but as of 1.6 (at least), the preferred way to provide
  options to Ajax.Request is as an object.  If you give it a string,
  that string will be converted to an object, and then later converted
  back into a string.  Yes, really. :-)  Also, String has a toJSON
  function you can use instead of JSON.stringify (not that it matters).

  So:

  entry = encodeURIComponent($('busCalForm').serialize(true).toJSON());
  new Ajax.Request(
      modules/buscal/processes/saveBooking.php, {
      parameters: {
          year: year,
          recnum: busmstr_id,
          json: entry
      },
      onSuccess: busCal.gotEntry.bind(this),
      onFailure: busCal.gotFailure.bind(this)

  });
   How can I effectively escape an entire form, without
   having to get the value and escape them individually?  Is there a
   command I'm missing?

  That's not quite what your code is doing; you're sending the form
  fields as a JSON-encoded string in a parameter called json.  If you
  just want to send the form fields, and you don't need them to arrive
  at the other end as a JSON string, there's a *much* shorter way:
  Form#request[2].  Assuming that your form element has the
  saveBooking.php as its action attribute:

  $('busCalForm').request({
      parameters: {
          year: year,
          recnum: busmstr_id
      },
      onSuccess: busCal.gotEntry.bind(this),
      onFailure: busCal.gotFailure.bind(this)

  });

  The form fields will no longer be JSON-ified (but will be properly URL-
  encoded), they'll arrive as individual parameters on the request.  If
  the form field doesn't have saveBooking.php as its action and you
  can't change that, the Ajax.Request can still be simplified:

  params = $('busCalForm').serialize(true);
  params.year = year;
  params.recnum = busmstr_id;
  new Ajax.Request(
      modules/buscal/processes/saveBooking.php, {
      parameters: params,
      onSuccess: busCal.gotEntry.bind(this),
      onFailure: busCal.gotFailure.bind(this)

  });

  [1]https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global...
  [2]http://prototypejs.org/api/form/request

  HTH,
  --
  T.J. Crowder
  tj / crowder software / com
  Independent Software Engineer, consulting services available

  On Jul 30, 8:27 pm, infringer infrin...@gmail.com wrote:

   I have a form, I've been doing this in javascript:

   entry = $('busCalForm').serialize(true);
   entry = JSON.stringify(entry);
   new Ajax.Request(modules/buscal/processes/saveBooking.php, {
            parameters: year= + year + recnum= + busmstr_id + json= +
   entry,
            onSuccess: busCal.gotEntry.bind(this),
            onFailure: busCal.gotFailure.bind(this)
            });

   But i have a user that has typed a # in one of the fields, and the
   script dies.  How can I effectively escape an entire form, without
 

[Proto-Scripty] Re: Escaping Input

2009-07-31 Thread Alex McAuley

You should always remove slashes from Json in php


Example below..
?php
$post=str_replace('\', '', $_POST['post']);
$json=$post;
$d=json_decode($json,true);
// now $d is an array made fromt the Json with name/value pairs if needs 
be

?
I had a similar problem with a PHP app i developed and had to escape it 
properly

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: infringer infrin...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 5:49 PM
Subject: [Proto-Scripty] Re: Escaping Input



This method works well in FF 3.5, but FF 3.0.12 doesn't like it...  I
really would like to keep the from coming in a separate variable, but
realize I may have to change that.

3.0.12's POST (truncated) just for info:
%7Bstartdate%3A%202009-04-23%2C%20

3.5's POST (truncated):
%7B%22startdate%22%3A%20%222009-04-23%22%2C%


As you can see 3.5 has extra characters...

I'm sending this to PHP, and my processing script receives the JSON
variable as such

$json_string = (isset($_POST['json']) ? rawurldecode($_POST['json']) :
);
$json = json_decode($json_string, true);
if (($json == '') || empty($json) || ($json == null)) {
$result['valid_result'] = 2;
$result['reason'] = rawurlencode(Unknown error, Administrator has
been notified.  Please try again later);
$result = json_encode($result);
header(Content-Type: application/json);
print $result;
exit(0);

}

so when users are using 3.0.xx they always receive this error message,
because the PHP script doesn't see it as valid JSON.

but 3.5 users (myself only) can perform the saves/deletes, etc

This is for an internal application, we only allow FF to be used.

Thanks for the help!
-David


On Jul 30, 4:00 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Sorry, I got my wires crossed half-way through the first one of
 those. You can't use String#toJSON, it's not a string! Doh.
 Correcting my first example:

 entry = encodeURIComponent(Object.toJSON($('busCalForm').serialize
 (true)));
 new Ajax.Request(
 modules/buscal/processes/saveBooking.php, {
 parameters: {
 year: year,
 recnum: busmstr_id,
 json: entry
 },
 onSuccess: busCal.gotEntry.bind(this),
 onFailure: busCal.gotFailure.bind(this)

 });

 Sorry 'bout that.

 -- T.J. :-)

 On Jul 30, 8:55 pm, T.J. Crowder t...@crowdersoftware.com wrote:



  Hi,

  You're sending an unencoded string (which happens to be in JSON
  format) as part of your parameters string, which is meant to be URL-
  encoded data. A # sign is the least of your problems. ;-) You'll
  want to encode that with JavaScript's encodeURIComponent function[1].

  Somewhat OT, but as of 1.6 (at least), the preferred way to provide
  options to Ajax.Request is as an object. If you give it a string,
  that string will be converted to an object, and then later converted
  back into a string. Yes, really. :-) Also, String has a toJSON
  function you can use instead of JSON.stringify (not that it matters).

  So:

  entry = encodeURIComponent($('busCalForm').serialize(true).toJSON());
  new Ajax.Request(
  modules/buscal/processes/saveBooking.php, {
  parameters: {
  year: year,
  recnum: busmstr_id,
  json: entry
  },
  onSuccess: busCal.gotEntry.bind(this),
  onFailure: busCal.gotFailure.bind(this)

  });
   How can I effectively escape an entire form, without
   having to get the value and escape them individually? Is there a
   command I'm missing?

  That's not quite what your code is doing; you're sending the form
  fields as a JSON-encoded string in a parameter called json. If you
  just want to send the form fields, and you don't need them to arrive
  at the other end as a JSON string, there's a *much* shorter way:
  Form#request[2]. Assuming that your form element has the
  saveBooking.php as its action attribute:

  $('busCalForm').request({
  parameters: {
  year: year,
  recnum: busmstr_id
  },
  onSuccess: busCal.gotEntry.bind(this),
  onFailure: busCal.gotFailure.bind(this)

  });

  The form fields will no longer be JSON-ified (but will be properly URL-
  encoded), they'll arrive as individual parameters on the request. If
  the form field doesn't have saveBooking.php as its action and you
  can't change that, the Ajax.Request can still be simplified:

  params = $('busCalForm').serialize(true);
  params.year = year;
  params.recnum = busmstr_id;
  new Ajax.Request(
  modules/buscal/processes/saveBooking.php, {
  parameters: params,
  onSuccess: busCal.gotEntry.bind(this),
  onFailure: busCal.gotFailure.bind(this)

  });

  [1]https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global...
  [2]http://prototypejs.org/api/form/request

  HTH,
  --
  T.J. Crowder
  tj / crowder software / com
  Independent Software Engineer, consulting services available

  On Jul 30, 8:27 pm, infringer infrin...@gmail.com wrote:

   I have a form, I've been doing this in javascript:

   entry = $('busCalForm').serialize(true);
   entry = JSON.stringify(entry);
   

[Proto-Scripty] Re: Escaping Input

2009-07-31 Thread Alex McAuley

Sorry - Just tucked into my first beer ...


not remove slashes ... Santitize the $_POST

My mistake.


Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: infringer infrin...@gmail.com
To: Prototype  script.aculo.us prototype-scriptaculous@googlegroups.com
Sent: Friday, July 31, 2009 5:49 PM
Subject: [Proto-Scripty] Re: Escaping Input



This method works well in FF 3.5, but FF 3.0.12 doesn't like it...  I
really would like to keep the from coming in a separate variable, but
realize I may have to change that.

3.0.12's POST (truncated) just for info:
%7Bstartdate%3A%202009-04-23%2C%20

3.5's POST (truncated):
%7B%22startdate%22%3A%20%222009-04-23%22%2C%


As you can see 3.5 has extra characters...

I'm sending this to PHP, and my processing script receives the JSON
variable as such

$json_string = (isset($_POST['json']) ? rawurldecode($_POST['json']) :
);
$json = json_decode($json_string, true);
if (($json == '') || empty($json) || ($json == null)) {
$result['valid_result'] = 2;
$result['reason'] = rawurlencode(Unknown error, Administrator has
been notified.  Please try again later);
$result = json_encode($result);
header(Content-Type: application/json);
print $result;
exit(0);

}

so when users are using 3.0.xx they always receive this error message,
because the PHP script doesn't see it as valid JSON.

but 3.5 users (myself only) can perform the saves/deletes, etc

This is for an internal application, we only allow FF to be used.

Thanks for the help!
-David


On Jul 30, 4:00 pm, T.J. Crowder t...@crowdersoftware.com wrote:
 Sorry, I got my wires crossed half-way through the first one of
 those. You can't use String#toJSON, it's not a string! Doh.
 Correcting my first example:

 entry = encodeURIComponent(Object.toJSON($('busCalForm').serialize
 (true)));
 new Ajax.Request(
 modules/buscal/processes/saveBooking.php, {
 parameters: {
 year: year,
 recnum: busmstr_id,
 json: entry
 },
 onSuccess: busCal.gotEntry.bind(this),
 onFailure: busCal.gotFailure.bind(this)

 });

 Sorry 'bout that.

 -- T.J. :-)

 On Jul 30, 8:55 pm, T.J. Crowder t...@crowdersoftware.com wrote:



  Hi,

  You're sending an unencoded string (which happens to be in JSON
  format) as part of your parameters string, which is meant to be URL-
  encoded data. A # sign is the least of your problems. ;-) You'll
  want to encode that with JavaScript's encodeURIComponent function[1].

  Somewhat OT, but as of 1.6 (at least), the preferred way to provide
  options to Ajax.Request is as an object. If you give it a string,
  that string will be converted to an object, and then later converted
  back into a string. Yes, really. :-) Also, String has a toJSON
  function you can use instead of JSON.stringify (not that it matters).

  So:

  entry = encodeURIComponent($('busCalForm').serialize(true).toJSON());
  new Ajax.Request(
  modules/buscal/processes/saveBooking.php, {
  parameters: {
  year: year,
  recnum: busmstr_id,
  json: entry
  },
  onSuccess: busCal.gotEntry.bind(this),
  onFailure: busCal.gotFailure.bind(this)

  });
   How can I effectively escape an entire form, without
   having to get the value and escape them individually? Is there a
   command I'm missing?

  That's not quite what your code is doing; you're sending the form
  fields as a JSON-encoded string in a parameter called json. If you
  just want to send the form fields, and you don't need them to arrive
  at the other end as a JSON string, there's a *much* shorter way:
  Form#request[2]. Assuming that your form element has the
  saveBooking.php as its action attribute:

  $('busCalForm').request({
  parameters: {
  year: year,
  recnum: busmstr_id
  },
  onSuccess: busCal.gotEntry.bind(this),
  onFailure: busCal.gotFailure.bind(this)

  });

  The form fields will no longer be JSON-ified (but will be properly URL-
  encoded), they'll arrive as individual parameters on the request. If
  the form field doesn't have saveBooking.php as its action and you
  can't change that, the Ajax.Request can still be simplified:

  params = $('busCalForm').serialize(true);
  params.year = year;
  params.recnum = busmstr_id;
  new Ajax.Request(
  modules/buscal/processes/saveBooking.php, {
  parameters: params,
  onSuccess: busCal.gotEntry.bind(this),
  onFailure: busCal.gotFailure.bind(this)

  });

  [1]https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global...
  [2]http://prototypejs.org/api/form/request

  HTH,
  --
  T.J. Crowder
  tj / crowder software / com
  Independent Software Engineer, consulting services available

  On Jul 30, 8:27 pm, infringer infrin...@gmail.com wrote:

   I have a form, I've been doing this in javascript:

   entry = $('busCalForm').serialize(true);
   entry = JSON.stringify(entry);
   new Ajax.Request(modules/buscal/processes/saveBooking.php, {
   parameters: year= + year + recnum= + busmstr_id + json= +
   entry,
   onSuccess: busCal.gotEntry.bind(this),
   onFailure: busCal.gotFailure.bind(this)
   });