• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Problem with cascading dropdowns

csim

Member
Hello,

I'm trying to cascade dropdowns with data fabrik.
Usually, cascading dropdowns works for me.
But in that case, I can't see what's wrong.

I have two dropdowns filters :
HTML:
<table class="filtertable fabrikList">
<thead>
<tbody>
<tr class="fabrik_row oddRow0 ">
<td>Service</td>
<td style="text-align:right;">
<select id="consultations___servicevalue" class="inputbox fabrik_filter input-small" size="1" name="fabrik___filter[list_3_com_fabrik_3][value][0]">
<option value="">Tous</option>
<option value="1">Anesth?sie hospitali?re - consultation</option>
<option value="3">Anesth?sie lib?rale - Consultation</option>
</select>
<input class="inputbox fabrik_filter input-small" type="hidden" value="=" name="fabrik___filter[list_3_com_fabrik_3][condition][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="AND" name="fabrik___filter[list_3_com_fabrik_3][join][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="`consultations`.`service`" name="fabrik___filter[list_3_com_fabrik_3][key][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="normal" name="fabrik___filter[list_3_com_fabrik_3][search_type][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="1" name="fabrik___filter[list_3_com_fabrik_3][match][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][full_words_only][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][eval][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][grouped_to_previous][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][hidden][0]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="19" name="fabrik___filter[list_3_com_fabrik_3][elementid][0]">
</td>
</tr>
<tr class="fabrik_row oddRow1 ">
<td>Sp?cialit?</td>
<td style="text-align:right;">
<select id="consultations___specialitevalue" class="inputbox fabrik_filter input-small" size="1" name="fabrik___filter[list_3_com_fabrik_3][value][1]">
<option value="">Tous</option>
<option value="Anesth?siste">Anesth?siste</option>
<option value="Appareillage">Appareillage</option>
</select>
<input class="inputbox fabrik_filter input-small" type="hidden" value="=" name="fabrik___filter[list_3_com_fabrik_3][condition][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="AND" name="fabrik___filter[list_3_com_fabrik_3][join][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="`consultations`.`specialite`" name="fabrik___filter[list_3_com_fabrik_3][key][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="normal" name="fabrik___filter[list_3_com_fabrik_3][search_type][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="1" name="fabrik___filter[list_3_com_fabrik_3][match][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][full_words_only][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][eval][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][grouped_to_previous][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="0" name="fabrik___filter[list_3_com_fabrik_3][hidden][1]">
<input class="inputbox fabrik_filter input-small" type="hidden" value="20" name="fabrik___filter[list_3_com_fabrik_3][elementid][1]">
</td>
</tr>
</tbody>
</table>

I have this code in javascript with jquery :
Code:
var $j=jQuery.noConflict();
 
 
$j(document).ready(function(){
if ($j('#consultations___servicevalue').size() > 0)
    {
        $j('#consultations___servicevalue').change(function() {
            changer_liste_specialites();
        });
    }
   
    }
 
});
 
//Changer la liste des sp?cialit?s
function changer_liste_specialites() {
    $j.ajax({
        type: 'POST',
        url: 'lister.php',
        cache: false,
        dataType: 'json',
        async: true,
        success: function(jsonData) {
            var msg;
            if (jsonData.resultat == 0) {
                alert('Probl?me de chargement de la liste specialite');
            }
            else {
                alert('OK');
            }
        },
        error: function (jqXHR,textStatus,errorThrown) {
        var msg;
        msg=jqXHR;
        var msg2;
        msg2=errorThrown;
        alert(textStatus);
        alert(errorThrown);
        }
    });
}

The result is always the same : textStatus=error, errorThrown= ID liste incorrecte
lister.php is not in cause : it does only that :
PHP:
$ajaxJson = array();
$ajaxJson['resultat'] = 1;
echo json_encode($ajaxJson);

Have you got an idea ? I'm lost.
Best Regards
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top