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

Disable textbox (quantity field) unless checkbox is checked


  1. patrickhait
    Member

    How can I disable a textbox (quantity field) unless it's associated textbox is checked? I'd like the box to be greyed out - so the user can't add text unless they check the checkbox.. as in the form below. The checkbox and the textbox are different items in the form - set up in two columns.

    http://seaclips.com/quantity-disable.jpg

    I think I found a javascript solution, but I don't know how to implement it... (http://stackoverflow.com/questions/31980041/disable-textbox-if-checkbox-is-not-checked)

    Thanks!

    Posted 8 years ago #
  2. frankzobitz
    Member

    Once you save your form, you would use the Logic area to show or hide fields.

    Posted 8 years ago #
  3. williamansley
    Member

    @patrickhait: I agree with frankzobitz. Unless you are absolutely wedded to the idea of having visible but disabled text fields until the check box is checked, then you will save yourself a load of time and trouble by using the built-in logic features of Machform and hiding the text fields until the checkbox is checked instead.

    That being said, I think Appnitro should give serious consideration to making logic rules in Machform more flexible. If we could use logic to toggle the status of a field between (enabled <-> disabled) or (optional <-> required), I think a lot of people would be happy. It would be great if we could also group fields so that one rule could affect two or more fields. Sometimes, that would work much better than skipping pages when dealing with multiple fields that should be shown or hidden together.

    Posted 8 years ago #
  4. patrickhait
    Member

    I never thought of hiding the fields. Thanks!

    Posted 8 years ago #

RSS feed for this topic

Reply