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

If Radio button == "1" Then object property user entered = required

ndjustin20
Registered: Oct 7 2009
Posts: 21
Answered

I would like to know if there is a way to change the user entered-required property of an object dynamically. i want to say something like:

if(radioButton1 == "1")

{

objectPropertyRequired = "Required";

}//end if

Any help is greatly appreciated.

Justin

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Yes, but you shold include some code the the "not equal to 1" situaton.

You will also have to reference the 'object' with the correct object reference and the property is 'manditory'. You might also want to create a 'mandatroy Message'.

if(CheckBox1 == 1) thenTextField1.mandatory = "error"TextField1.mandatoryMessage = "TestTield1 is a manditory"xfa.host.setFocus("TextField1")elseTextField1.mandatory = "disabled"endif

George Kaiser

ndjustin20
Registered: Oct 7 2009
Posts: 21
Ok so that didn't work. Can you give me a working example with say a radio button with yes/no and say a dropdown list and an email button. So if you click yes on the radio button then you won't be able to email as adobe will shoot back an error that the field is mandatory. I tried your example and cant' get it to work.
ndjustin20
Registered: Oct 7 2009
Posts: 21
Also, I shouldn't say it didn't work :) I can't get it to work so maybe you got it to work but I can't seem to get it to work no matter how I try it.
ndjustin20
Registered: Oct 7 2009
Posts: 21
I'm sorry it worked i just wasn't using the code correctly. Thank you very much for your help on this one.