-
1. Re: How do I Section a form??
George_Johnson Feb 2, 2014 10:40 AM (in response to BSisson)You say you want to disable sections, but what exactly does that mean? Do you want to make the fields read-only, hide the fileds, make the fields and the underlying page contents disappear, or something else?
-
2. Re: How do I Section a form??
BSisson Feb 2, 2014 12:12 PM (in response to George_Johnson)My form has sections already, grounds, heating, cooling, plumbing, etc....
Occasionally, a section "Doesnt Apply" and I want to grey out, hide, dissable or otherwise skip the entire section.
Since I must account for the worst case platform (reader) I can't hide entire sections, or use some of the other neat features.
I could put a "Grey filled box" over the extire section if the "N/A" box was checked and make sure that I cleared all the checkboxes in that section as well. Seems ineligant, but sometimes the simplist is the best.
Any other ideas on how to "Skip" and entire section of a form?
PS...glad to send you a copy of my "proof_of_concept" form...just PM me an email I can send a PDF to.
-
3. Re: How do I Section a form??
George_Johnson Feb 2, 2014 12:42 PM (in response to BSisson)OK. This can be done fairly easily if yuo use a hierarchical naming system for you form fields. For example, prefix all of your fields in section 1 with "S1.", tso they have names like: "S1.cust_name", "S1.address", "S1.city", etc. You can then hide all of the fields in a group with a single line of JavaScript:
// Hide all of the secition 1 fields
getField("S1").display = display.hidden;
If you include an opaque button to cover all of the section (e.g., set the background to white and make it read-only), you can hide the underlying page contents by doing:
// Show the section 1 button
getField("S1_cover").display = display.visible;
In this case don't include the "S1." prefix.
Do the same type of thing for the other sections. You can then set up a general function in a document-level JavaScript to show/hide any section, something like:
function hideFormSection(section, hide) {
// Determine whether to show or hide the fields
var disp = hide ? display.hidden : display.visible;
// Dtermine whether to show of hide the cover button
var disp_cover = hide ? display.visible : display.hidden;
// Show/Hide the fields
getField(section).display = disp;
// Show/Hide the cover button
// Each section cover button is named: prefix + "_cover". Example: "S1_cover"
getField(section + "_cover").display = disp_cover;
}
And you could call it like this:
// Hide section 1
hideFormSection("S1", true);
// Show section 3
hideFormSection("S3", false);
-
4. Re: How do I Section a form??
BSisson Feb 2, 2014 2:09 PM (in response to George_Johnson)Wow that looks easy.
I was already going to name my fields Checkbox.section.field_number.
This is how I can build a summary very easily later, by looping through Section and Field Number and extracting the "Export Data" into a text field on the summary page.
I already have some button-up scripts that make a fied required if they say they have a component.... I can just do something similar for the entire section and add a Text-box over it with a grey fill. More stuff for my Proof-of-concept form.
thanks.


