Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I change the Required state of a field conditionally in ConfiForms?

Willy Case November 9, 2018

Hi,

I am working on a form in ConfiForms. I would like to add or remove certain entries conditionally, some of which I'd like to make required. Here's an example:

Entry1 - Dropdown - Yes / No - Required

Entry2 - Text

Entry3 - File

If Entry1 = Yes, show Entry2 and Entry3, and make them required.

If Entry1 = No, hide Entry2 and Entry3 and make them not required.

 

Right now, I'm able to hide/show the entries no problem, but if I make Entry2 and Entry3 required, then when you hide them you can't submit the form, because they are empty.

I can't seem to figure out how to make them not required (if it's possible).

I could also set them to default values, but I can't seem to get that to work for a file entry box.

 

Any suggestions?

2 answers

1 vote
fbunting
Contributor
March 29, 2019

You can achieve the same effect by adding two rules (two Confiforms Rules for Field Definition macros) ... one to Show/Hide the second field, and the other to make it required.

For the second macro, the Action to execute would be Validation rule, and rule itself would simply be .+ (any non-empty value).

Like fbunting likes this
0 votes
Tim Oldendorf
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2019

Hi Willy - just curious if you were ever able to figure this out? I have the a similar issue I am looking to solve. 

Willy Case January 8, 2019

Unfortunately I did not find an exact solution. I ended up making the potentially hidden fields as not required for now until I can find a better option.

Tim Oldendorf
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2019

Aw bummer! Well I will update if I find a solution. I think this could be a very helpful feature. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events