Hide a button using jQuery

function beforeLoad(scriptContext) {

        let form = scriptContext.form;

           // Create an inline HTML field to inject the script

           let inlineHtmlField = form.addField({

               id: ‘custpage_inlinehtml’,

               type: serverWidget.FieldType.INLINEHTML,

               label: ‘Inline HTML’

           });

 

           // Script to hide the row using jQuery

           let script = “<script>jQuery(document).ready(function() { jQuery(‘Button_ID’).hide(); });</script>”;

           // Set the default value of the inline HTML field to the script

           inlineHtmlField.defaultValue = script;

      }

Leave a comment

Your email address will not be published. Required fields are marked *