• Resolved eberkland

    (@eberkland)


    In the settings for checkbox field there are two choices to tick:

    • Include quantity boxes
    • Display when choice ticked

    How does this work? I could not find anything in the documentation or on this forum.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @eberkland

    By ticking the quantity boxes checkbox the plugin displays a number input tag per checkbox choice and as the field’s value the plugin multiples the choice’s value by the quantity.

    If you tick the “Display when choice ticked” attribute in the checkbox field’s settings, the plugin will display the number input tag only if the corresponding choice is ticked.

    Best regards.

    Thread Starter eberkland

    (@eberkland)

    Thanks, user error on that one, I see quantity boxes now.

    I am assigning texts and values to checkbox fields (see example below), is there a way to assign an initial value for the checkbox quantity from another field?

    getField(fieldname455|n).setChoices({texts:[‘Accent Shelf’], values:[fieldname331]});

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @eberkland

    You should include the quantities property in the object you pass as the parameter in the setChoices method.

    getField(fieldname455|n).setChoices({texts:['Accent Shelf'], values:[fieldname331], quantities:[45]});

    Instead of 45, you can use a field’s name.

    Best regards.

    Thread Starter eberkland

    (@eberkland)

    You’re the best! This completely solved several workarounds I was doing. Thanks.

    Thread Starter eberkland

    (@eberkland)

    Follow-up question on this topic.

    On my closet builder calculator, users can select the number of drawers they want in a number field (fieldname123)

    Then they can select the number of knobs they want in a checkbox field (with quantity options ticked).

    They can select less than the number of chosen drawers, but not more.

    Is there a way to set quantities assigned to the checkbox as the max-value. So users would not be able to select more than the quantity in fieldname123.

    getField(fieldname455|n).setChoices({texts:[‘Drawer Knobs’], values:[fieldname331], quantities:[fieldname123]});

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @eberkland

    You can do it with some code. For example, the equation’s code might be:

    getField(fieldname455|n).jQueryRef().find('[type="number"]').attr('max', fieldname123);

    Best regards.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Checkbox Include Quantity Boxes’ is closed to new replies.