Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable Save and Save and Close buttons

FaisalKhan
Contributor III

How to disable Save and Save and Close buttons by using the Custom Code?

10 REPLIES 10

Ilya_Khen
Champion III

Faisal,

 

For example:

<script>
Sys.Application.add_load(function() {
$('#master_btnSave').hide();
$('#master_btnApply').hide();
});
</script>

Thank you Ilya Khen, the thing is this that i just want to disable the Dave button like when it is disabled During the View Mode is there any way to do that. 

Yes, in 6.6 I would do:

<script>
Sys.Application.add_load(function() {
$('#master_btnSave div').addClass( "tb-btn-disabled" );
$('#master_btnApply div').addClass( "tb-btn-disabled" );
$('#master_btnSave').unbind('click').prop("onclick", null);
$('#master_btnApply').unbind('click').prop("onclick", null);
});
</script>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

That probably would work in 6.5 too, just so that I have currently 6.6 as a Test env.

Arun.Prasad
Advocate II

As an alternate code, try the below. I have used it in 6.4 SP1.. 

 

But I would definitely go with Ilya's code, seems more reliable.

 

<script type="text/javascript">   
Sys.Application.add_load(function() {
$('#master_btnSave').attr('href',"#").removeAttr('onclick');
$('#master_btnSave > div > div > img').removeAttr('onclick');
$('#master_btnApply').attr('href',"#").removeAttr('onclick');
$('#master_btnApply > div > div > img').removeAttr('onclick');
});
</script>

Thank again, we are having 6.5 and it is making the buttons in grey color but still clickable save action is happening

Thanks Arun but unfortunately it is not working may be due the fact that we are having 6.5 p3

Really? You probably have used older code. Check the post again.

No, I have used:

<script>
    Sys.Application.add_load(function() {
        $('#master_btnSave div').addClass( "tb-btn-disabled" );
        $('#master_btnApply div').addClass( "tb-btn-disabled" );
    });
</script>

It is making it visibly inactive but if you click on it.. save functionality is there

Like mentioned:

<script>
    Sys.Application.add_load(function() {
        $('#master_btnSave div').addClass( "tb-btn-disabled" );
        $('#master_btnApply div').addClass( "tb-btn-disabled" );
        $('#master_btnSave').unbind('click').prop("onclick", null);
        $('#master_btnApply').unbind('click').prop("onclick", null);
    });
</script>