problem with joomla, php and json

Posted by sebastian on Stack Overflow See other posts from Stack Overflow or by sebastian
Published on 2010-06-16T17:53:21Z Indexed on 2010/06/16 18:32 UTC
Read the original article Hit count: 227

Filed under:
|
|
|

hi,

i have a problem with a joomla component. i'm, unsing php and json for some dynamic drop down boxes. here is the code:`

jQuery( function () {
    //jQuery.ajaxSetup({error : function (a,b) {console.dir(a); console.dir(b);}}); 
    jQuery("#util, #loc").change( function() {
    var locatie =  jQuery("#loc").val();
    var utilitate = jQuery("#util").val();
    if ( (locatie!= '---') && (utilitate!='---') ) 
        jQuery.getJSON(
            "index.php?option=com_calculator&opt=json_contor&format=raw",
            { locatie: locatie, utilitate: utilitate }, 
            function (data) {
                var html = ""; 
                if ( data.success == 'ok' ) 
                    for (var i in data.val) 
                        html += "<option name=den_contor value ='"+ i+"' >" + data.val[i]+ " </option>";
                jQuery("#den_contor").html( html )  
            }
        )
    })
});

the query works, but only on one PC. we have exactly the same xampp server, exactly the same files. on one pc it works, and on a online server and on my pc it doesn't.

EDIT: i have three drop down boxes, the first is populated directly from the database, the second has 4 predefined values. and the third is populated depending on combination of the first two.

i have a test site online. http://contor.redxart.com must be logged in to use Calculator in the menu. you can make an new account :)

"Adaugare Index" is the part that isn't working

any ideas?

thanks, sebastian

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript