Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Error message on unclicked Radio Button

Avatar

Level 2

Hello all, I was wondering how I can generate a unique error message on a required radio button on my form. I have designated the radio button as required already, but instead of the generic "missing fields" error message I would like it to generate a specific one saying "Form Must Be Reviewed with Supervisor Prior to Submission" in addition to the one that pops up when other required fields are not filled.

6 Replies

Avatar

Level 10

You could write an if statement that specifically checks the value of that field and then pops up a message.

Are you using a custom submit script or are you using one of the default submit buttons?

Avatar

Level 2

I think I am using the default submit button. I chose the Button object, clicked "Submit" under control type, then under the "Submit" tab I chose to submit it as a PDF with a mailto: my email address.

Avatar

Level 10

One way to do it is to use 2 submit buttons.

You want to hide the real submit button and use a "fake" submit button (just a regular button) to check the value of the field. If the field is ok then you click the real submit button programmatically.

On the Click event of the fake submit button (JavaScript):

if (RadioButtonList.rawValue == "") {

     xfa.host.messageBox("Form Must Be Reviewed with Supervisor Prior to Submission");

}

else {

     EmailSubmitButton1.execEvent("click");

}

Hope that helps!

Avatar

Level 2

Ah yeah I had previously used the two buttons when I had originally used a mandatory checkbox instead of a mandatory radio button. The problem is, the "real" email submit button must be regular button that I can designate the data be sent as a PDF. Thus when I use a button, it disables my ability to use a click function and some javascript on it.

Avatar

Level 10

I'm not following you...it shouldn't matter what your real email submit button is for this code to work.

Can you share your form via acrobat.com or the like?