0

I'm using some AJAX (ASP.NET Web Forms) to add new selectable elements on my site but the newly created ones aren't selectable. I guess this has to do with some events. Maybe it can be solved by using .on on those functions but I don't know how to do it. Anyone know how to fix that?

Here's my code:

$(".selectable").selectable({
filter: '.ui-widget-content',
stop: function () {
    var result = $("#select-result").empty();
    $(".ui-selected", this).each(function () {
        var index = $(this).attr('id');
        index = index.substring(12, index.length);
        result.append(" #" + index);
    });
}
});

1 Answer 1

2

when you load your page, jquery assign respective functions to each html tags. when you create some new div/html tags you should re-initialize the function because jquery doesn't know about your newly created html tags,

for the respective query try re initializing the jquery function after adding new selectable element

hope this help..

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.