This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Prevent ticking of a checkbox


  1. Robolovsky
    Member

    I know this sounds odd but I have a form set up for selling greetings cards and the customer is required to tick a checkbox for the card/s they wish to purchase. Whenever a particular one is out of stock I replace its image with a Sold Out sign and ideally I need to prevent the checkbox for that item from being ticked. This is preferential to removing the item altogether as it is easier to reinstate the card when it is back in stock. Can you tell me if there is a way of making a checkbox read-only?

    Posted 8 years ago #
  2. williamansley
    Member

    @Robolovsky: You are talking about making one check box out of a set of several in the same check box field read only, is this correct? There is no way to do that that in the standard Machform interface that I know of. In fact, the new "read only" option is not available for check box fields at all. Perhaps someone else will have a helpful idea, but I cant't think of any workarounds for this, either. Sorry.

    Posted 8 years ago #
  3. Robolovsky
    Member

    These are individual single checkboxes and not part of a set. So each item has a checkbox with an image of the relevant card. The box is ticked in order to bring up a quantity dialogue which is otherwise hidden. When sold out, I remove the logic for displaying the hidden quantity field so ticking the box has no effect but making it untickable or being able to hide the checkbox while still seeing the image would be good.

    Posted 8 years ago #
  4. williamansley
    Member

    @Robolovsky: Rather than removing the logic, you could add an additional, hidden checkbox for each visible checkbox that you want to disable. (The additional checkbox can't be admin-only; if admin-only fields are used in logical expressions, the logic doesn't work.) Change your logic so that the quantity field is not displayed when the hidden box is checked or perhaps an "Out of stock" message in a section break field could be displayed instead when the hidden box is checked and the user checks the "order item" box.

    By editing the form and making the default state of the hidden checkbox field checked, by checking it in the field properties panel and saving the form, you can disabled/re-enable each individual checkbox with less effort than removing/adding logic.

    I think this will work for you, but it depends on the details of your form.

    Posted 8 years ago #

RSS feed for this topic

Reply