Search
-
How do you hide form elements dynamically?
Scenario: Ihave created 4 Change templates, one of which is a Standard Change. I have extended the Change class to include a new enum list which contains all of our standard changes. I have created a custom Change form to expose the extended list which works fine. However, what we would like to do is hide the list if… -
Re: How do you hide form elements dynamically?
Martyn You are correct you will want to do something similar to the linked discussion, using an onReady custom task. Read more about it in this KB Article: https://support.cireson.com/KnowledgeBase/View/1188#/ But just off the top of my head app.custom.formTasks.add('ChangeRequest', null, function(formObj, viewModel){… -
Re: How do you hide form elements dynamically?
I just stumbled across a solution for this. There may well be a more elegant way of doing it but it works so I'm happy. :) <p> var StandardChangeLabel = $(".form-group label[for='StandardChange']");<br> var StandardChange = StandardChangeLabel.next();<br> StandardChangeLabel.hide();<br> StandardChange.hide(); </p> Thanks… -
Re: How do you hide form elements dynamically?
Martyn Sorry for the delay I was on vacation. So below is the full solution, does this answer your questions? app.custom.formTasks.add('ChangeRequest', null, function(formObj, viewModel){ formObj.boundReady( function () { //the CR template id is in the URL if(pageForm.viewModel.TemplateId == 'TemplateStringId') { //do what… -
Re: How do you hide form elements dynamically?
Martyn This should work for both new and existing WI created from a template app.custom.formTasks.add('ChangeRequest', null, function(formObj, viewModel){ formObj.boundReady( function () { //the CR template id is in the URL if(pageForm.viewModel.TemplateId == 'TemplateStringId') { //do what you need here, hide fields etc }…