How set read-only submit button in service portal and platform

Hemanth267
Tera Contributor

Hemanth267_0-1700575029446.png

 

7 REPLIES 7

Samaksh Wani
Giga Sage
Giga Sage

Hello @Hemanth267 

 

var bt = document.getElementById('button_name');
bt.disabled = true;

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

where I need to write this script ? in widget HTML page?

Shane J
Tera Guru

Instead of disabling a button (I assume conditionally, you've given 0 detail in regard to requirements), you usually setup a Catalog Client Script that will runs onSubmit and prevents submission.  Example below:

 

function onSubmit() {
    var checkbox = g_form.getValue('ac_found');
    if (checkbox == 'true') {
        alert('Selected user already has an active access record. You will be unable to submit this request.');
        return false;  //prevents submission if condition is met
    }
}


Best I can offer up for 'disabling a button' is a Google search:  https://www.google.com/search?q=bootstrap+disable+button&rlz=1C1GCEO_enUS1020US1023&oq=bootstrap+dis...

I need to disable/Read-only on portal