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();
        });
    }
 
    }
 
});
 
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 msg2;
        msg2=errorThrown;
        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​
 
I'll need to see the page. Can you fill in your My Sites info (link to the left of any of your posts) for the URL and any login details I need. And respond here with and details I need to navigate to the list in question.

-- hugh
 
Just checking in ... no My Sites info yet ... I'll check back later.

Basically, anything to do with JavaScript, we'll need to have access to the page, so you can save a little time by giving us the details in your first post, or updating your My Sites accordingly if you don't want to publish the URL. Only Fabrik staff can see your My Sites info.

-- hugh
 
Well, the code is actually:

Code:
    if ($j('#consultations___specialitevalue').size() > 0)
    {
        $j('#consultations___specialitevalue').change(function() {
            //changer_liste_specialites();
//alert($j('#consultations___specialitevalue').val());
if ($j('#consultations___specialitevalue').val() != '')
{
$j('#consultations___servicevalue').hide();
}
        });
    }

... so the changer_liste_spcialites() isn't getting called.

Not much i can do to debug it. So was that alert ever popping up?

What element types are the two filter elements?

You still haven't filled out your My Sites, so I can't get at the back end to look at any of this stuff. I saw your email just now ... but I really can't do anything until you fill ou that My Sites info, so I can get at your site to see the setup, and preferably with either ftpo details, or exTplorer installed, so I can modify your JS.

-- hugh
 
Still no My Sites, and you've emailed me with questions several times.

We don't do support by email. And I can't answer questions about JS and AJAX code without being able to access your site, and see the files. if you need my help, you'll need to give me a backend login, and either install exTplorer, or give me ftp account details your your My Sites. Otherwise, it's kind of like asking a mechanic to help fix your car, but refusing to let him look under the hood or give him the car keys!

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top