cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Save Button when a value list change

EliasTabarez1
Contributor III

Hi!

Im try to hide Save button when value list change. I have this code, but this works when i load the form or i save the record with this value. ¿How can i hide the button when the value is changed? I think is necessary in the on change event.

 

<script type="text/javascript">
var valuesListFieldId = 23258; // This is the field id of the values list
var valuesListValueAId = 65413; // This is the id of the value to check against
var valuesListValueBId = 65414; // This is the id of the value to check against
var valuesListValue;

Sys.Application.add_load(function() {
valuesListValue = getValue(valuesListFieldId);

if (valuesListValue.indexOf(valuesListValueAId) != -1 || valuesListValue.indexOf(valuesListValueBId) != -1 ) {
$("#master_3840:CUST").hide(); // Hide Allocated controls
$("#master_btnApply").hide(); // Hide Save button

$("#20767auditInfo").hide(); // hide key auditing info
$("#wftran3840:CUST").hide();
$("#master_commandsDiv").hide();
}
});
function getValue(fldId) {
var RPFieldRoot = ArcherTech.UI.ClientContentManager.GetInstance().getFieldById(fldId);
var RPFieldRootId = RPFieldRoot.clientId;

return $('input[id*="'+ RPFieldRootId +'"]').val();
}
</script>

 

THanks in advance

1 ACCEPTED SOLUTION
9 REPLIES 9

Hi Ilya!

Thanks, i changed the code and works fine:

$('div[id*="f'+ 23258 +'c"]').change(function() {

if($CM.getFieldValue(23258) == '65414:0' || $CM.getFieldValue(23258) == '65413:0'){

 

$("#master_3840:CUST").hide(); // Hide Allocated controls
$("#master_btnApply").hide(); // Hide Save button

$("#20767auditInfo").hide(); // hide key auditing info
$("#wftran3840:CUST").hide();
$("#master_commandsDiv").hide();
}
});
});

Now, i have two problem

How can i show the button again if i select another value?

And, how can i hide the save icon? save icon.png

Ilya_Khen
Champion III

.show() function is the counterpart of .hide() function.

Ok, thanks, now i can show and hide save icon.png

Is it possible to hide the save icon too?

Thanks so much!

Ilya_Khen
Champion III

Right click on the icon and do Inspect to reach Browser Dev Tools. You will find the element in the HTML source which you need to hide/show. Are you speaking about context save icon btw?

Hi Ilya, thank i will check this.

Im trying to hide this save button: icon save.png

Ilya_Khen
Champion III

Yes, check the element ID. In my version, there is no save icon, it is placed as context menu item.

Ok! thanks so much!!

Ilya_Khen
Champion III

Anytime