Copy link to clipboard
Copied
I have a form that one of the questions is Male or Female and a Radio button for each choice, after selecting Female I want a drop down menu that asks if Pregnant. So I have put a drop down next to it with a Yes or No to select. Obviously if you select male I want the drop down to be grey out or not able to select it. Thank you in advanced for the help.
Copy link to clipboard
Copied
Let's say your choices in radio buttons are named "Male" and "Female" and your dropdown field is named "Pregnant,
use this as 'Mouse Up' action (Run a JavaScript) of "Male" radio button:
if(event.target.value == "Male")
this.getField("Pregnant").readonly = true;
use this as 'Mouse Up' action (Run a JavaScript) of "Female" radio button:
if(event.target.value == "Female")
this.getField("Pregnant").readonly = false;
Copy link to clipboard
Copied
Let's say your choices in radio buttons are named "Male" and "Female" and your dropdown field is named "Pregnant,
use this as 'Mouse Up' action (Run a JavaScript) of "Male" radio button:
if(event.target.value == "Male")
this.getField("Pregnant").readonly = true;
use this as 'Mouse Up' action (Run a JavaScript) of "Female" radio button:
if(event.target.value == "Female")
this.getField("Pregnant").readonly = false;
Copy link to clipboard
Copied
It might also be a good idea to reset the "Pregnant" field when "Male" is selected, just in case.
Copy link to clipboard
Copied
Thank you for your answer, however it gives me an error. Im not sure if this makes a diference but the Male Femal Radio buttons and Pregnant drop down menu are part of a radio group called "Aplicant Gender".
Copy link to clipboard
Copied
What is the error you get?
Copy link to clipboard
Copied
Actullay I did a mistake it works, however if I select Female and also select yes or no, then l go back and select Male "Yes" or "No" is still displayed.
Copy link to clipboard
Copied
What should be displayed? You said you only have "Yes" and "No" in dropdown, do you have a default value like empty space or something else?
Copy link to clipboard
Copied
I got it, there is a blank space option and I just realised that the mouse up can have 2 functions and one of them I set up is to reset the form but I de selected all and just maid it to reset "Pregnant", thanks alot!!