The CreatorCon Call for Content is officially open! Get started here.

Grayed out field along with UI action when user click on it.

coolsaurabh
Tera Contributor

Hi

I have created a UI action Locked and when user click on it two field of form (start_date and end_date)should be grayed out and this UI action button Locked out should also get grayed out.

But I observed that when I reload the form then this button and required field again come into editable mode.

I am using below script :-

function set(){

  g_form.setReadOnly('start_date', true);

  g_form.setReadOnly('end_date', true);

  document.getElementById("locked_out").disabled = true;

  }

I want that user can click on Locked bbutton only once and then after it becomes grayed out and start date and end date also remains grayed out. Even after reload form.

Thanks,

Sourabh

8 REPLIES 8

Abhinay Erra
Giga Sage

When I say check box, I meant to say true/ false field. In your UI action, uncheck the client check-box and put this in the code



current.<field name of true/false field>=true;


coolsaurabh
Tera Contributor

Hi Abhinay



I have perform below activity :-



1) Create check box cb on form.


2) Create a UI action as well and mentioned condition current.cb=true;


3) Then I create a client script :-



function onLoad() {


    //Type appropriate comment here, and begin script below


    if(u_cb == 'true')


      document.getElementById("cb").disabled = true;


}



But it is not working. Please correct me. I got the concept but not able reconnect the things.


Abhinay Erra
Giga Sage

Your client script should be this



function onLoad() {


    //Type appropriate comment here, and begin script below


    if(g_form.getValue('u_cb'))


      document.getElementById("cb").disabled = true;


}


Richa29
Kilo Contributor

Hi ALL,

I need a help for below condition, when anyone cancel the change, then other fields like "save" and "submit change" should be grayed out.

Whenever “Cancel Change” ui action clicked other UI actions like “Save” and “Submit Change” should be grayed out.