Cascading Dropdowms not Triggering change fucntion

Forums Cascading dropdowns Cascading Dropdowms not Triggering change fucntion

This topic contains 1 reply, has 2 voices, and was last updated by  Alexander Bautz 2 months ago.

  • Author
    Posts
  • #20270

    Diego Barrientos
    Participant

    Hi Aalex,

    We have an issue with a cascade field when trying to use a change function:

    $(‘#Trainer_casc’).change(function () {
    alert(‘Trigger on Trainer’);
    trainerSelected = $(‘#Trainer_casc option:selected’).text();
    getTrainerData(trainerSelected);
    });

    The change function never gets triggered but if we use a SPJS-Lookup field it works.

    Any idea?

  • #20295

    Alexander Bautz
    Keymaster

    The element with ID “Trainer_casc” doesn’t exist when you run this code so you should change it like this:

    $("#dffs_Trainer").on("change","select",function () {
        alert("Trigger on Trainer");
        trainerSelected = $("#Trainer_casc option:selected").text();
        getTrainerData(trainerSelected);
    });

    You could however just set up a rule to change on the “Trainer” field instead – did you try that?

    Alexander

You must be logged in to reply to this topic.