Conditional Appearance of Form Sections Based on Option/Radio Selections

W

wordUser

Suppose I have a form like the one below between the two sets of
double/equal sign lines.

Section 1 asks the user to specify a type from 4 possible options (in an
HTML form, these would be radio-style options).

Section 2 then shows one of four fieldsets, depending on the option
selected in Section 1. These include field labels (like "Equipment
manufacturer name:"), and of course field inputs, some being one- or
multi-line text boxes (perhaps with validation of input), others something
similar to an HTML select element (see the "how many persons..." field),
which when selected/changed, creates another fieldset of controls whose
count is based on the selection.

I am thinking of doing this form up in Word, with appropriate VB code, and
that this form will be set up properly in PDF when rendered. My ability
to code in VB is virtually nil, and I have a passing familiarity with
Adobe Acrobat Javascript (I have no problem with Javascript in HTML
documents).

I am thinking to have this form available in both Word docx form and in
PDF, which is why I want the trouble with Word. Where can I get a quick-
and-dirty tutorial in coding in VB to get form sections to appear and
disappear based on option selections? Will this code be properly set up
in Adobe PDF version of the form, or do I have to play with Javascript?

==================================================================
1. Choose the type of report you are making:

[ ] Equipment broken
[ ] Equipment out of calibration
[ ] Incident/conflict with person
[ ] Dispute or protest about operating policy


2. Please describe

-------------- Option 1 selected ----------
Equipment manufacturer name:
Equipment model/product name and/or number:
Equipment serial number:
Equipment location:
Date and time of defect or break or its first observation:
Short title/description of defect or break:
Detailed description of defect or break:
-------------- Option 2 selected ----------
Equipment manufacturer name:
Equipment model/product name and/or number:
Equipment serial number:
Equipment location:
Date and time when uncalibrated state noticed:
Short title/description :
Detailed description of equipment's uncalibrated state:
-------------- Option 3 selected ----------
Location of incident (if multiple locations, list all):
How many persons were involved in the incident/conflict? [ ]
==> create list count depdending on answer
1. Name:
2. Job title:
3. Description of behavior of this person
Additional Comments:
-------------- Option 4 selected ----------
Institute Policy Details (list title of policy and number, if it has one)
Points of Disagreement (best presentation is bulleted or numbered list of
the separate points at issue):
==================================================================




I can do Javascript (as in Adobe Acrobat), but my ability to code in
VisualBasic is quite stunted.
 
D

Doug Robbins - Word MVP

See the following pages of Greg Maxey's website :

http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

http://gregmaxey.mvps.org/Populate_UserForm_ListBox.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

wordUser said:
Suppose I have a form like the one below between the two sets of
double/equal sign lines.

Section 1 asks the user to specify a type from 4 possible options (in an
HTML form, these would be radio-style options).

Section 2 then shows one of four fieldsets, depending on the option
selected in Section 1. These include field labels (like "Equipment
manufacturer name:"), and of course field inputs, some being one- or
multi-line text boxes (perhaps with validation of input), others something
similar to an HTML select element (see the "how many persons..." field),
which when selected/changed, creates another fieldset of controls whose
count is based on the selection.

I am thinking of doing this form up in Word, with appropriate VB code, and
that this form will be set up properly in PDF when rendered. My ability
to code in VB is virtually nil, and I have a passing familiarity with
Adobe Acrobat Javascript (I have no problem with Javascript in HTML
documents).

I am thinking to have this form available in both Word docx form and in
PDF, which is why I want the trouble with Word. Where can I get a quick-
and-dirty tutorial in coding in VB to get form sections to appear and
disappear based on option selections? Will this code be properly set up
in Adobe PDF version of the form, or do I have to play with Javascript?

==================================================================
1. Choose the type of report you are making:

[ ] Equipment broken
[ ] Equipment out of calibration
[ ] Incident/conflict with person
[ ] Dispute or protest about operating policy


2. Please describe

-------------- Option 1 selected ----------
Equipment manufacturer name:
Equipment model/product name and/or number:
Equipment serial number:
Equipment location:
Date and time of defect or break or its first observation:
Short title/description of defect or break:
Detailed description of defect or break:
-------------- Option 2 selected ----------
Equipment manufacturer name:
Equipment model/product name and/or number:
Equipment serial number:
Equipment location:
Date and time when uncalibrated state noticed:
Short title/description :
Detailed description of equipment's uncalibrated state:
-------------- Option 3 selected ----------
Location of incident (if multiple locations, list all):
How many persons were involved in the incident/conflict? [ ]
==> create list count depdending on answer
1. Name:
2. Job title:
3. Description of behavior of this person
Additional Comments:
-------------- Option 4 selected ----------
Institute Policy Details (list title of policy and number, if it has one)
Points of Disagreement (best presentation is bulleted or numbered list of
the separate points at issue):
==================================================================




I can do Javascript (as in Adobe Acrobat), but my ability to code in
VisualBasic is quite stunted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top