These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Radiobutton list not highlighted even though defined as 'required'

Lea1337
Registered: Jul 14 2009
Posts: 64
Answered

I have a couple of forms containing both textfields and radiobutton lists, all of which are defined as 'User entered - required' in the Object palette.

I'm using the standard E-mail submit button in LiveCycle, only I have changed the attachment from xml to pdf. When a user tries to submit the form without filling all required fields, all the missing textfields are highlighted, but none of the radiobutton lists.

Since the error message indicates that all required fields are highlighted it is unfortunate that the radiobutton lists lack this highlighting, thus maybe confusing the user.

Does anyone know why this does not work, or how I can make it work?

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I just tried this, and yes it doesn't work. That's irritating isn't it:(. If Acrobat isn't highlighting then you'll have to write some code to do it yourself, I'd suggest using the "PreSubmit" event on the radio button group.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Lea1337
Registered: Jul 14 2009
Posts: 64
Ok, so now at least I know that I didn't do anything wrong, it's just a limitation in LiveCycle, thanks for the input.

I have written some code that takes care of the highlighting, but now I'm facing another problem (not directly related, but somewhat). I also have a 'reset' button in my form, which in my opinion should remove highlightet areas (if you have tried to Submit without filling all required fields, and then wish to reset the form).

Problem is that clicking the reset-button doesn't remove the highlighting from the texfields. I have no problem removing the hightlighting from the radio button lists, since I wrote the code that defined the highlighting (using the border-edge color). But do you know how I can remove the highlighting from the textfields? I have tried setting the border-edge color to white, but this didn't help. Since it is the predefined Submit-button that sets the highlighting on the textfields, maybe it uses some other attribute to set the highlighting?
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There's no direct or clean way to get rid of the "mandatory" highlighting. But you can do it indirectly.

Change the field "mandatory" property to "disabled" before the reset action. The only way to get the highlighting back, when you want it, is to change the fields back to "error" at some later point. For example, in the submit button.

Acrobat just has it's own ideas about how things should work. If you want your own behavior then the only other solution is to do all the form level validation and field highlighting with your own script.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

here is a very interesting thread about the support of radio buttons by Acrobat/Reader 8.0 and later and problems that may occur.
[url]http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Lea1337
Registered: Jul 14 2009
Posts: 64
Thanks for the tips, I've learned a few new things now :-)

I tried using the mandatory-settings in the submit button (change the fields to "error"), but that did not highlight any of the fields that I set to mandatory, so I dropped this functionality.

I have probably written a whole lot of "bad" code now, but I've at least got all the validation working by doing it manually and highlighting manually. By doing that I could also highlight only the required fields that are empty, and not every single required field.

But, during testing I discovered a new error (of course..). I have a few subforms that should be hidden upon opening the form, and will be set to visible by the user through some radiobuttons. When working on these subforms in LiveCycle, I keep them visible, so I've used the 'initialize' event from the Main_subform to hide the subforms on preview. But I noticed that when I submit the form, and the form is sent by e-mail, the subforms are hidden again. Is this because of the 'initialize' event? What other event can I use to hide the subforms only upon opening the form, not when it's being submitted?
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
You should use a script in the form ready event of the subform, that checks the actuals state of the radio button.

if (radioButton1.rawValue == 1){this.presence = "hidden";}else{this.presence = "visible";}

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Lea1337
Registered: Jul 14 2009
Posts: 64
I think maybe I explained myself poorly in the last post, bevause I don't think I can use the code but you suggest.

My subforms are supposed to be hidden when the form is opened by the user. There are a few questions that the user must answer 'yes' or 'no' to (these are radiobuttons). If he answers 'yes', the subform is set to visible (in the 'click' event of the radiobutton), and the user must then fill in some more information contained in the subform.

When finsihed filling out the form, the user presses 'Submit', and the form is e-mailed to me. When I open the form, all the subforms that are supposed to be visible given the user's choices, are now hidden again.

How can I prevent this from happening? I have used the 'initialize' event on the Main_subform to hide the subforms upon opening the form, but I suspect this also hides them again when the form is being submittet, or am i wrong? I tried using the form:ready event on the Main_subfom, but this results in the same problem.
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

look at this sample form.

https://share.acrobat.com/adc/document.do?docid=3f4a0363-156a-4eba-b8db-8a995bd20f8c

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

Lea1337
Registered: Jul 14 2009
Posts: 64
Ok, I see now what the idea was. Thanks, works much better now! :-)
casawang
Registered: Aug 31 2010
Posts: 1
I also have the same problem. I did what was suggested above and emailed the form as a PDF.
When the PDF form is opened, the subforms that should be visible are hidden. The only way to show the subforms that were filled in is to click off and click on the checkbox that displays the corresponding subform.

Is there another way to make those subforms visible before the form is emailed?