Problem, or bug? with autoform's afFieldValueIs helper

I’m working on a project that will have an extensive user input form with many cases of needing to show and hide sections of the form… .ie, the user will answer Yes or No with a radio button, and depending on the answer, more questions may show up.

So, after much research, I came across afFieldValueIs, a helper with autoform that can be used to show and hide sections of html

only problem is, it doesn’t seem to work.

I put together a github repo here:

If you try it, you will see that you can click Yes or No, and a message will show up below it, depending on your selection.

But, if you open up an existing record, it will not properly set the message below the radio button. Hit refresh in the browser to reload the page, and it will correctly show the message… click yes and no a few times and it will start to update.

There is a bug with the latest version of AutoForm. Use version 5.4.0 instead.

1 Like

Thank you @serkandurusoy I can confirm that using 5.4.0 fixes this issue. The 5.4.1 release mentions that he changed how getFieldValue works, and that is used for the afFieldValueIs, so I hope this can be fixed soon!

1 Like