Here's what I want to achieve, I have a select box that loads in a few rows, when the select is changed (onchange) the key is AJAXed to a PHP function that returns an array in the JSON format, my code then clears the select box options and applies the values I have just returned from my PHP function, great.
The problem is when the new values are set it fires the onchange event again, this sets the values and we're at the beginning of a never ending loop. Firebug catches the error and spits it out.
My question is is there a way to disable the onchange event so it only fires once? I'm coding in a framework based around prototype, posting a code example would be a bit heavy, however I can attempt to fill in any missing data upon request.
Cheers! ILMV