Workflow Soluiton

 View Only
  • 1.  Workflow 7.5 CheckBox onclick event question

    Posted Apr 01, 2014 09:09 AM

    Hi all:

    I'm working on Workflow 7.5, and I'm trying to check the onclick event on a CheckBox.

    The simplest test I can imagine is to show an alert window when the event fires, but I'm not able to get this to work.

    In my web form, I have a CheckBox with Functionality tab > Control ID = ChkBoxTest1.

    In Functionality tab > Custom Events I have an onclick event with the following code:

    window.alert('Onclick event');

     

    When I run the workflow, I cannot get the window alert to appear when I click on the checkbox.

    If I create a DropDownList and I assign the same code to the onpropertychange event and it works properly.

    Am I missing any step?

    Thanks in advance:

                Falquian



  • 2.  RE: Workflow 7.5 CheckBox onclick event question
    Best Answer

    Posted Apr 01, 2014 01:49 PM

    Use a single checkbox inside a checkboxlist component.  That does work.



  • 3.  RE: Workflow 7.5 CheckBox onclick event question

    Posted Apr 01, 2014 02:03 PM

    I've posted a file in the downloads with a workaround I have used in the past. Here is the link (might still be pending approval):

    https://www-secure.symantec.com/connect/downloads/work-around-workflow-checkbox-onclick-events

     

    The checkbox list item above will also work, but the one I linked will fire two separate events based on the state of the box. Keep in mind, it will fire the first time the page loads as well, but you can work around this with some additional javascript if needed.



  • 4.  RE: Workflow 7.5 CheckBox onclick event question

    Posted Apr 01, 2014 03:27 PM

    Yes, it's currently pending approval - I'll make it available as soon as possible

    Thanks
    Cheryl



  • 5.  RE: Workflow 7.5 CheckBox onclick event question

    Posted Apr 02, 2014 08:15 AM

    The onclick javascript should look like this:

     

    var myCheckBox = document.getElementById('ChkBoxTest1');

    if(myCheckBox.checked)

    {

         alert("tada");

    }



  • 6.  RE: Workflow 7.5 CheckBox onclick event question

    Posted Apr 03, 2014 02:59 AM

    Hi all:

    Thanks all for helping me in this issue.

    I marked BRING's comment as the solution as it works really great.

    I downloaded David Parks package but didn't have time yet to test it.

    @reecardo: I already had a very similar code on my onclick event code, but it never got executed...it seems there is any kind of problem on the implementation of the checkbox component, and it never fires the onclick event. I'll create an Idea so hopefully there is a fix in next versions, hotfixes or whatever :)

    Kind regards:

             Falquian