Form fields visible when click on UI actoin

ganeshexpert
Kilo Contributor

I want the field to be visible on incident form when user click on form header button newly created. Then user enter the value for that fields and update the incident. Is it possible to create show form fields when user click button.

 

Thanks in advance.

5 REPLIES 5

harikrish_v
Mega Guru

Hi Ganesh,



You can do it via 2 client scripts as well. This way, if you want the button to perform some activity once user enters the value for that field, you dont have to get confused with how to write client and server code on the same UI action.


First write a UI policy or an onLoad client script to hide the field. Then you can write the below code in an onSubmit client script:-



function onSubmit() {


  var action = g_form.getActionName();


  if(action == '<your buttons action_name>'){


          g_form.setVisible('<your_field_name>',true)


          g_form.setMandatory('<your_field_name',true);


          return false;


  }


}


Hope this helps.



Thanks & Regards,


Hari