Workflow and ServiceDesk Community

 View Only
  • 1.  Checkbox to set Label and Textbox to visible

    Posted Jul 29, 2014 03:04 PM

    hello,

     

    I have a project where i need to have a checkbox, once clicked, show more fields for the user to input data into.  I created a checkbox component and added the following code to an onclick event.

    var AltMgr_Label = document.getElementById('AltMgrLabel')
    var AltMgr_FirstNameLabel = document.getElementById('AltMgr_FirstNameLabel')
    var AltMgr_LastNameLabel = document.getElementById('AltMgr_LastNameLabel')
    var AltMgr_FirstNameText = document.getElementById('AltMgr_FirstNameText')
    var AltMgr_LastNameText = document.getElementById('AltMgr_LastNameText')

    if(!checkbox.checked)

    {

    AltMgrLabel.visible = "True";
    AltMgr_FirstNameLabel.visible = "True";
    AltMgr_LastNameLabel.visible = "True";
    AltMgr_FirstNameText.visible = "True";
    AltMgr_LastNameText.visible = "True";

    }

    But when i test the project, checking the checkbox does not set the fields/labels to visible.  I configured each field as Visible = False in the component editor.



  • 2.  RE: Checkbox to set Label and Textbox to visible
    Best Answer

    Broadcom Employee
    Posted Jul 29, 2014 03:38 PM

    Well the checkbox component already has custom events predefined to hide other web components depending on its checked state. Have you tried to use these? You would leave the Visible values on the fields you want hidden left to True and then add the custom HideIfValueIsEmptyorNull custom behavior specifying a specific form component. You would simple add as many of these as you need.

     



  • 3.  RE: Checkbox to set Label and Textbox to visible

    Posted Jul 29, 2014 03:56 PM

    thank you that worked perfectly!!