Explore the community Forums Lectora Lectora Questions & Answers Change Status of Checkbox

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #283503 Score: 0
    Profile photo of clammers
    clammers
    Member
    beginner
    intermediate
    contributor
    curious george
    wise owl
    picture perfect
    friend finder
    advanced
    entry
    entry
    20 pts
    @clammers

    Is it possible to change the status of a checkbox without clicking it (specifically, within a form)? I need to be able to change the state of a checkbox based on other selections, as per the example below:

    The user can select 1 of 3 values from Column I – Option 1, Option 2, Option 3. Based on that selction, they will be able to select multiple values from a list of options (A-G) in Column II – if Opion 1 is selected, A-C become available; if Option 2 is selected, D-F becomes available; and if Option C is selected, G becomes available.

    The problem I’m running into is, if I make Option 1 available, the user can select A-C. If they then choose Option 2, they can select D-F, although A-C will remain checked.

    I can limit the user from only selecting one value in the first choice, Column I, II, or III by utilizing show/hide options, but can’t seem to figure out a workaround for the secondary column.

    I can provide images of the example if necessary.

    #287264 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    339 pts
    @ssneg

    Use action “Change contents” on a checkbox to modify it. Set it to “on” to toggle on, set to empty string to toggle off.

    So in your case:

    1. Create radio button group with 3 radio buttons. Add 9 checkboxes, group them in 3 groups of 3.

    2. Add the following action to the radio group (not to buttons!) – “On select/change” – run group “Clear all”

    3. Action group “Clear all” should contain 9 actions like:
    – change contents – checkbox_1 – set to “”
    – change contents – checkbox_2 – set to “”
    – change contents – checkbox_3 – set to “”

    – change contents – checkbox_9 – set to “”

    4. It also should contain 3 actions like:
    – hide Checkbox_Group_1
    – hide Checkbox_Group_2
    – hide Checkbox_Group_3

    5. Radio button 1 should contain:
    – action “On select/change” – show Checkboxes_Group_1
    Same for the other two.

    So what’s going to happen as soon as ANY radio button is selected, every time:
    – first all checkboxes are reset to unchecked and hidden
    – then the required checkbox group is displayed

    Check it out: https://dl.dropboxusercontent.com/u/11433463/trivantis/checkboxes/index.html

    #287266 Score: 0
    Profile photo of clammers
    clammers
    Member
    beginner
    intermediate
    contributor
    curious george
    wise owl
    picture perfect
    friend finder
    advanced
    entry
    entry
    20 pts
    @clammers

    Thanks, ssneg – I’ll give it a try.

    What is the logic behind putting the action on the radio group instead of the button? Just to cut down on actions? A bit more in-depth on this project, multiple Columns should be able to be selected; therefore, I can’t use a radio button group. [I suppose I could parse out the different Columns into specifics (e.g. Column I, Column II, Column III, Column I & II, Column I & III, etc.), but this is not ideal.]

    If at all possible, I would like the user to select multiple Columns, then the subsequent options. So, a user could select Column I and Column III, Options A, B, and E; but then if they select Column II, all Options would clear out until the user makes a new selection. Additionally, I would like all the Options to be visible, but only certain Options able to be selected when the Column(s) are selected.

    #287265 Score: 0
    Profile photo of Sergey Snegirev
    Sergey Snegirev
    Member
    contributor
    intermediate
    advanced
    friend finder
    lab member
    junior moderator
    advocate
    LUC16
    LUC16 Attendee
    wise owl
    339 pts
    @ssneg

    When you add an action triggered by Change/Select to radio group, it triggers when any radio button in the group is selected. When you add it to a radio button, it triggers when that particular button is selected.

    Instead of showing and hiding entire groups of checkboxes, you can show and hide semi-transparent overlays that “disable” them.

    I attached the source file, feel free to play with it.

    [ATTACH]631[/ATTACH]

    #287262 Score: 0
    Profile photo of mallow76
    mallow76
    Member
    beginner
    intermediate
    contributor
    wise owl
    curious george
    23 pts
    @mallow76

    see if the attached does what you need. similar to sneg’s but using checkboxes. choices are cleared if any changes made to column selection.

    edit: group 5 in the example is not required. forgot to delete it.

    #287267 Score: 0
    Profile photo of clammers
    clammers
    Member
    beginner
    intermediate
    contributor
    curious george
    wise owl
    picture perfect
    friend finder
    advanced
    entry
    entry
    20 pts
    @clammers

    Thank you both for your help on this. After looking at both of your titles, I’ve realized what the issue is: I was using custom form elements (Gel). Apparantly the ‘Change Contents/Set Text/Checkbox#’ will only work on the default form elements (for checkboxes at least).

    I applied all the same actions to my title as were on each of yours, and they boxes wouldn’t uncheck. I updated the preferences to not use custom form objects, and then everythign fell into place. I’ll have to submit a case to Trivantis for this one.

    Thanks again!

    #287263 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    354 pts
    @timk

    When using customized checkboxes / radio buttons the problem is that these aren’t checkboxes. They are just images that hide / show each other on click. The real checkboxes are also on the page but invisible. The real checkboxes are checked / unchecked by click on the images.

    That means all your actions that target the checkboxes do work but it’s not visible because the real checkboxes aren’t visible.

    Tim

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.