Copy link to clipboard
Copied
Currently creating an application form where there are required "Yes" or "No" answers (using radio buttons).
1. I'd like to have the form require either Yes or No to be selected but not both. I've used the required selection under Properties>General. However, it is still requiring both to be checked even though they are in the same group.
I've read several js scripts but they don't seem to fit these needs as it seems to be too simple.
2. Also, on another part of the form, if the applicant marks "Yes" I'd like a text box then be required (to explain why). So, first require a "Yes" or "No" if "Yes" then require "Textbox1"
3. If at all possible, if the applicant hasn't selected an option in the required radio button group, have the group display a message "Select at least one option"
The closest I could find to #2 is, I believe:
if (event.target.value == "Three") {
this.getField("Text Field 1").required = false;
}
For #3 I believe it is similar to:
<script>
function validateForm() {
var x = document.forms["myForm"]["radioGroupName"].value;
if (x == "") {
document.getElementById("message").innerHTML = "Select atleast one option";
}
</script>
Any assistance would be greatly appreciated. Thank you.
The red border only means the field is set as required. It doesn't change when you fill it in (or not).
The validation of the required fields only occurs when you actually submit the file.
If you want the red border to appear/disappear based on whether or not the field has a value you would need to use a custom script to do it.
Copy link to clipboard
Copied
For question 1, I don’t understand what you mean by “requiring Both” since the essence of a radio button group is that you can only have one selected. If you can select more than one of them the name must be different so they aren’t a group.
Copy link to clipboard
Copied
Hello Test Screen Name, thank you for your reply.
I just did a quick check to see if there weren't in the same group and I do have them in the same group. So, I don't think that is it. I've attached the editor view photo for you to see what I am trying to express (albeit somewhat poorly, lol).
So, as you can see, they are in the same group and I have them all as required fields. So when I go to try and fill out the application form it results in the following:
For some reason it is still showing that the other radio buttons are required.
I hope this clears up what I was trying to say. Thank you again for your help.
Copy link to clipboard
Copied
The red border only means the field is set as required. It doesn't change when you fill it in (or not).
The validation of the required fields only occurs when you actually submit the file.
If you want the red border to appear/disappear based on whether or not the field has a value you would need to use a custom script to do it.
Copy link to clipboard
Copied
I see, thank you.
I have been trying to write a script to do something to that effect. Can you help with the writing of the script? I'm not sure as to where to start and I have been going through the forums to figure out how to do so.
btw, are you the same try67 that has the website? Custom-made Adobe Scripts
I've gone through it and read a few of your answers online, they've been really helpful in the past. Thank you!
Copy link to clipboard
Copied
I am!
Glad to hear you found my website useful. If you wish me to develop this script for you feel free to contact me privately.
Copy link to clipboard
Copied
Have you defined them as required? That isn't necessary for radio buttons.
Copy link to clipboard
Copied
Yes, I have them as required so that the applicants won't skip past them (unfortunately, it happens).
Do you know of another way to make it so that the person can't skip past them or gets a notification that they need to fill in that area?
Copy link to clipboard
Copied
Hello.Did you find the answer for the No1 question?Because i have the same problem.If yes please sent me the answer.Thanks
e-mail klothos2@gmail.com
Copy link to clipboard
Copied
Read the full thread, please. I answered this question above.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now