开发者

jquery one hyperlink should be enabled at a time

开发者 https://www.devze.com 2023-03-14 13:41 出处:网络
I have created two hyper links with Create User and Batch If one hyper clicked a pop up is being opened , and at the same time when other hyper link (Batch ) should not be opened

I have created two hyper links with Create User and Batch

If one hyper clicked a pop up is being opened , and at the same time when other hyper link (Batch ) should not be opened

(Currently both are being opened )

Please tell me how to resolve this ??

please see my code :

var create = dojo.create("div",{
            id:"create_links",
            className:"iconRow1",开发者_运维百科
            innerHTML:"<a class='popupLink' href='javascript:openDialog()'>Create User</a> <span>|</span><a  href='javascript:openFileDialog()'>Batch </a>"
        }


function openDialog() {


        dojo.byId('create_links').disabled=true;
        $("#create_links").addClass("disabled");

// some code 


    }

The other hyper link code is

  function openFileDialog() {


       $("#fileuploadfun").attr('title',"Batch");
       $( "#fileuploadfun" ).dialog({ position: 'center' , zIndex: 0, width: 500, show: 'slide', resizable:'false' });

    }

Currently the Dialog bOxes are created in this way :(This is for Batch)

  $("#fileuploadfun").attr('title',"Batch ");
       $( "#fileuploadfun" ).dialog({ position: 'center' , zIndex: 0, width: 500, show: 'slide', resizable:'false' });

And the User dialog is created this way :

$( "#createUserDialog" ).dialog( "option", "title", 'Create User' );        
$( "#createUserDialog" ).dialog("open");


The links cannot be disabled by just any attribute.The way to disable any link is by simply removing the onclick or replacing the href with # or javascript:void(0) to avoid jumping to page top.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号