UI formatter showing/hiding on the form based on a choice field and make it mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2016 09:43 AM
Hi all,
I have a requirement where I have a drop down field, and based on the selection of the choices, I need to make a UI formatter visible/hide on the change request form.(if choice is 'Yes', then show the UI formatter and make it mandatory, if 'No' then hide it.).
Is it possible to achieve this? If yes, kindly share your ideas with me. Any help is high appreciated.
Thanks and Regards,
Shruthi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2016 11:04 PM
Did you try using onChange client script? You can use setVisible and give formatter name ...
Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2016 01:23 AM
Yes, I have tried. But it does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2016 10:47 AM
UI formatter in not a field so setVisible or setDisplay method will not work.
You will have to try out DOM level manupulation.
You can use the $ selector to element ID and hide it using DOM methods when particular condition is met.
You can check below link for sample example
How to hide the attachments showing on top of item and task forms
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2016 11:23 AM
I guess you also can take a look at my blog post where I use DOM manipulation to hide the an UI action.
How to hide/show an UI action on field changes
//göran