Highlighted

Need Help with Signature Field

_Win_Lam_

23-11-2008

Hi.



Can someone kind help me with this:



I have 3 questions with a Yes/No radio button answer.



If all 3 buttons are "No", then i would need to have my signature image as "visible" and another radio button status turned on/selected.



How may i do this? i need serious help......!

Replies

Highlighted

Thomas_McConnac

24-11-2008

if (radioGroup1.rawValue == "No" && radioGroup2.rawValue == "No" && radioGroup3.rawValue == "No")

{

signature.presence = "visible";



//Note the single '=' here, not the '=='

radioGroup3.rawValue = "Yes";

}

else

{

// Hidden is removed from the layout, invisible is there in the layout but a blank space

signature.presence = "hidden";



//Note the single '=' here, not the '=='

radioGroup3.rawValue = "No";

}



I would put it in the change event for each radio group.
Highlighted

_Win_Lam_

24-11-2008

Hi Thomas, Thanks for your advice....

I've tried to plot the script and changing it's name values to that of the fields, but it doesn't seem to work.



Can you also explain to me what's the difference between "==" and "="?
Highlighted

Thomas_McConnac

24-11-2008

"==" is an expression, or a test so will return either true, or false depending on if the test comes back as true (e.g. 1 == 1 returns true, 1 == 2 returns false)

"=" is setting the value of the field and will return true if it manages to set the value (I have several times put in only a single "=" by mistake and spent a long time wondering why it seemed to be doing somethign when it shouldn't)



As for not working, check what the radio groups are returning as their raw values by using:



xfa.host.messageBox("" +radioGroup1.rawValue );



It might be set to associate the radio's with a numerical value (In the Object > Binding tab).



Tom
Highlighted

_Win_Lam_

24-11-2008

Dear Tom,

May I know if i can set a submit button to print the form at the same time with only 1 button?

1 more question, on the script above, y would we need to include the last script (radioGroup3.rawValue = "Yes";) at the last?
Highlighted

Thomas_McConnac

25-11-2008

Hey Win,



Setting the (radioGroup3.rawValue = "Yes") was what I thought you wanted it to do. Maybe you just wanted to make that visible too? 🙂



Glad you got it working,



Tom