how to target dropdownlist for jquery event

3 posts, 0 answers
  1. Doug
    Doug avatar
    68 posts
    Member since:
    Aug 2014

    Posted 27 Jun Link to this post

    I have added to my form a change to my save button if any (various) inputs are changed.
    $(document).ready(function () {
        $("input,select,textarea").change(function () {
            $("#<%=btnSaveDataFull.clientid %>").addClass('SkinPulgin_button_update');
        });
    });


    this works for the textboxes, textareas ,comboboxes
    but not dropdownlists changes.
  2. Doug
    Doug avatar
    68 posts
    Member since:
    Aug 2014

    Posted 28 Jun in reply to Doug Link to this post

    looks like these are just spans so I will add an OnClientSelectedIndexChanged for each drop down to just call the button save data to change colors.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Magdalena
    Admin
    Magdalena avatar
    421 posts

    Posted 29 Jun Link to this post

    Hello Doug,

    DropDownList does not contains any input, select or textarea. If the OnClientSelectedIndexChanged event does not meet your expectations, you can bind the ".rddlFakeInput" element to the DOMSubtreeModified event.
    $('.rddlFakeInput').bind("DOMSubtreeModified", function () {
        console.log("changed");
    });


    Regards,
    Magdalena
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top