Ok, managed to solve this.

With the Ajax request, I did completely replace the <select> dropdown
and mootools seems to clean up any events that are related to the
element being replaced.

So I changed the code to

function li_events(){
$('lum_sel').addEvents({
            change: function (){
                var x1 = new Ajax(

'/index.php?option=com_lightingcalculator&task=xml&type=la&id='+$('lum_sel').value+'&preset='+$('lam_sel').value,
                    {
                        method: 'get',
                        update: 'lamp_dropdown',
                        evalScripts: true
                    }
                ).request()
            ;

            }
});
$('lam_sel').addEvents({
            change: function (){
                var x2 = new Ajax(

'/index.php?option=com_lightingcalculator&task=xml&type=lu&id='+$('lam_sel').value+'&preset='+$('lum_sel').value,
                    {
                        method: 'get',
                        update: 'luminaire_dropdown',
                        evalScripts: true
                    }
                ).request()
            ;

            }
});



}

window.addEvent('domready', function(){

li_events();

});



and appended <script language="javascript">li_events();</script> to
the end of every ajax response.


HTH, Jochen

On Thu, Nov 27, 2008 at 8:29 AM, Jochen Daum <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On Thu, Nov 27, 2008 at 8:13 AM, Dmitry Ruban <[EMAIL PROTECTED]> wrote:
>>
>> Hi Jochen,
>>
>> You are assigning both events to the same element #lun_sel. Is it correct?
>> If yes, why you can't just put both ajax calls into one function?
>>
> aarggh. No not correct.
>
> However, after changing this it still doesn't fire a second time.
>
>
> Jochen
>

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to