Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2022-01-03 08:03 AM - edited 2022-01-03 08:04 AM
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
2022-01-03 12:06 PM
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?
2022-01-03 12:17 PM
.show() function is the counterpart of .hide() function.
2022-01-03 12:29 PM
Ok, thanks, now i can show and hide
Is it possible to hide the save icon too?
Thanks so much!
2022-01-04 02:02 AM
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?
2022-01-04 03:15 AM
Hi Ilya, thank i will check this.
Im trying to hide this save button:
2022-01-04 03:17 AM
Yes, check the element ID. In my version, there is no save icon, it is placed as context menu item.
2022-01-04 03:19 AM
Ok! thanks so much!!
2022-01-04 03:29 AM
Anytime