There’s nothing in Freeway alone that can do this, but it’s very simple to do with some JavaScript. Post an example page with the entire form laid out, and mark the items you want to hide (maybe change the background color on that part of the page, perhaps) so we can see what you want to do.
Walter
On Nov 14, 2014, at 3:52 AM, Alex Lyons email@hidden wrote:
Just a quick one,
following a few tutorials but can’t get this one.
I have a form and I was hoping to have a number of fields hidden until a specific check box is ticked and then rebidden if it is untucked…
See the below link. The fields with the value “hide” should be hidden unless the check box immediately to the left of them is checked. Individual for each line.
If the box is checked, all three fields should show.
You’re going to have a lot of trouble starting with this layout. It looks to me as though you have the Table Layout feature turned on in Freeway, and then you drew the form elements on the page and aligned them how you wanted them to appear. While this works from the standpoint that the form is going to submit to the server (although your form fields are not named in any logical manner at all – just item57 and so forth), the fields are not organized in a way that a script could recognize.
The way to get Freeway to give you a solid and unbreakable form layout while maintaining a sense of order to the generated code is to draw a table with the table tool, then set its borders to 0 (so they don’t show on screen). The benefit to this is that you will have a single <tr> tag wrapped around all of the form fields in one row, so you can do something simple like say “if this checkbox is checked, all of the remaining text fields in this row are visible”. That English is remarkably similar to the code you would write. Here’s a “fiddle” showing what I mean.
Look in the bottom-right block for a working example, and the bottom-left block for the code you’d need to write. (I used Prototype.js to make the code less dense.)
This only works if all of your checkboxes and all of your text inputs are arranged in the manner of my example. Again, if you just draw things on the page, you don’t get to control this at all. Draw a table, insert your elements within it, and style the table to be hidden. Your code will be simpler, and your script will be able to manipulate it without explicit references to each element by name.
Thanks for the response. I haven’t had a chance to look at this but what you say makes perfect sense in that I understand why you say to do these things.
Making it happen on my end however, is a different thing and I’ll try it shortly and get back to you!
David, the code you gave does the trick, except the fields default to being seen. If I check the box they stay there, but then uncheck it the disappear… so close.
I would love the titles of each column to be hidden unless one check box is check… I’ll try a work around as I reckon it might be a bit awkward
unfortunately that didn’t work as planned… I followed your steps and it results in the fields now being hidden regardless of what happens with the checkbox…