0

I am creating a site walk-trough on first signup for users. For this I chose to use live elements on the landing view as they appear more customized for each user than pictures. I am using jQuery clone for drawing my live objects to my walk-through modal.

   $(".dashboard_content").clone().appendTo( ".t_dashboard_content" );

I now need to disable all links, form submit action and modal popups in the cloned object.Solutions here are resulting in target elements on the original elements being disabled also which is undesirable. Any leads to attaining this are welcome.

Community
  • 1
  • 1
Stephen Mudere
  • 444
  • 3
  • 10
  • 1
    Possible duplicate of [How do I dynamically enable/disable links with jQuery?](http://stackoverflow.com/questions/3788946/how-do-i-dynamically-enable-disable-links-with-jquery) – edhurtig Jun 11 '16 at 01:34

2 Answers2

1

you could try to everwrite the link onClick event:

$('a').click(function(ev){

        // A global variable you use to enable/disable following links
        if(isLinkDisabled) {
                ev.preventDefault();
                return false;
        }

        return true;

});
Mario Santini
  • 2,905
  • 2
  • 20
  • 27
0

I finally came up with the following though its slow.

     $( ".t_dashboard_content" ).each(function(){
                    //Disable links
                    $("a").attr("href", "#")

                    //Disable form submit
                    $(".search_btn").attr("type", "button");

                    //Disable modal
                    $(".advanced").attr("data-toggle", "");
                });
Stephen Mudere
  • 444
  • 3
  • 10