Moving/Copying/Creating BS4 Slider Control

During runtime: Cutting and pasting HTML from template containers on hidden forms to a container on the base form removes any active on event handlers, as expected. If you were using onclick events, it’s easy after the app pastes the HTML to set new on events with jQuery using something like this:

$('#SomeButton').on('click', function (event) {
  // event handler

However, the BS4 slider has an onmousedown event that is needed, but is created by BS4/AS. I’m assuming I would need to do something similar to Create a control at runtime, but I’m struggling with which jQuery function to use on a slider to “activate” it. In that post, I’m looking at this line only, as I inserted the HTML, rather than adding the control via jQuery.


Actually, BS4 radio and check box controls are not copied correctly using either a cut and paste or even a copy and paste at runtime. Not only are the event handlers missing, but properties like value are missing. I’m not sure it’s worth trying to make this work. I’m looking at another method that does not include moving HTML to have a generic form with multiple internal layouts.

Here’s four examples of others who tried this and found the event handlers and other code doesn’t copy. They all use the innerHTML method I suggested in the post New App Design Considerations Part 7 - Copying HTML. And they all redefine the events after the paste. None of them tried to use BS4 controls, nor could I find a post with BS4 controls and SPA routing.

A new approach is needed. I’ll update New App Design Considerations Part 7 - Copying HTML when I determine a better solution to HTML “templates” in AS.