Symantec IGA

 View Only
  • 1.  Prompt a Message on Ticking a Checkbox in Identity Portal

    Posted May 15, 2018 10:56 AM

    Hi,

     

    We have a check-box on the Identity Portal form, and wants to display a message only when the check-box is ticked.

     

    Have tried the below in the change Handlers of the Identity Portal Form which displays the message but, this display both when we tick or un-tick the checkbox.

    api.prompt("Hello");

     

    I am trying something like the below, to just prompt the message only when the checkbox is ticked. But this does not seem to work.

    var a = api.getProp('testbox').checked;
    if (a == 'true'){
    api.prompt("Hello");
    }

     

    or 

    var a = api.getProp('testbox');
    if (a == 'true'){
    api.prompt("Hello");
    }

     

    If anyone tried this?

     

    Regards,

    Lav Malhotra



  • 2.  Re: Prompt a Message on Ticking a Checkbox in Identity Portal

    Broadcom Employee
    Posted May 15, 2018 04:42 PM

    Seems like a coding issue here

    Try this:

    if (api.getProp('testbox').checked) {
         api.prompt("Checked");
    } else {
         api.prompt("Not Checked");
    }

     

    Use chrome browser and look for errors in developer tools->console.



  • 3.  Re: Prompt a Message on Ticking a Checkbox in Identity Portal

    Posted May 16, 2018 01:14 AM

    Hi,

     

    Thanks for the response. Tried the below code as well, but it goes under the else block every time. Either I check the box or uncheck, it gives Not Checked as the prompt.

     

    Just for information ‘testbox’ is the reference name of my checkbox property on the form. Hope this is correct.

     

    Will try to look for errors in the console of Chrome.

     

    Regards,

    Lav Malhotra



  • 4.  Re: Prompt a Message on Ticking a Checkbox in Identity Portal

    Broadcom Employee
    Posted May 16, 2018 01:36 AM

    Using Reference name 'testbox' is correct.

     

    add following console log statement and update this thread with the screenshot on console screen of chrome or IE 's developer tool.

     

    console.log(api.getProp('testbox'));

    console.log(api.getProp('testbox').checked);

    if (api.getProp('testbox').checked) {
         api.prompt("Checked");
    } else {
         api.prompt("Not Checked");
    }



  • 5.  Re: Prompt a Message on Ticking a Checkbox in Identity Portal

    Posted May 16, 2018 02:06 AM
      |   view attached

    Hi,

     

    Thanks for the prompt reply. Here is the screen print of console after adding the below code.

     

     



  • 6.  Re: Prompt a Message on Ticking a Checkbox in Identity Portal
    Best Answer

    Broadcom Employee
    Posted May 16, 2018 02:16 AM

    Great. From console it is clear checkbox doesn't have property name "checked" rather it has property name "values" to hold the checkbox status.

     

    Tyr this code now:

    console.log(api.getProp('testbox'));

    console.log(api.getProp('testbox').values[0]);

    if (api.getProp('testbox').values[0] == "true") {
         api.prompt("Checked");
    } else {
         api.prompt("Not Checked");

    }

     

     

     



  • 7.  Re: Prompt a Message on Ticking a Checkbox in Identity Portal

    Posted May 16, 2018 04:41 AM

    Hi,

     

    Thanks for the help, it works

     

    Regards,

    Lav Malhotra