• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 462
  • Last Modified:

Hide / display Form fields based on user selection using PDF Form

Hi guys,
I am trying something new and need some help. I have created a PDF form using Adobe LiveCycle and have inserted a drop-down field. I am trying to create a way for my users to select from the drop-down menu and only relevent fields be displayed below.
Below the drop down field is several check boxes with text, but I only need the relevant check box and text be available when applicable. Can someone lead me in the right direction?

  • 2
  • 2
1 Solution
The question is very general, so i'll try to answer you with a general solution.

Supposing your dropdown has several entries, each with its own value (i.e. item1, item2, item3...),  give to each checkbox  a dummy styleclassnamed as the select value associated, you can use more class name together if necessary.

The whe the onChange event fires, take the value selected and select the checkboxes using the getElementsBy Class (see below). Then cycle all your checkboxes and set a display:none style to them, cycle the lements returned by the previous function and assign a display:block or display:inline style to them.

Only relevant checkboxes will be showed in the page.

function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
	return classElements;

Open in new window

nkengie81Author Commented:
A little over my head, but I will give it a shot. Thanks for you rapid response.
nkengie81Author Commented:
OK, I am really new to this, and really don't know what to do with the above information. Can someone help me out ABC style?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now