Display depend on previous field type

I am trying to create a simple questions, where the display of a new field is dependent on the previous questions value.
E.g. Are you Diabetic >>this is a 'select; field type with Options as Yes/No
If the user select ‘Yes’, then next field type ‘Simple Text’ has to be shown.

What is the best way to enable this?

in doctype or customize form,
set the depends on for the 2nd field as

eval: doc.first_fieldname == 'Yes'

1 Like

Thanks, I tried this option earlier too, it says ‘Missing Semicolon’ unrecoverable syntax error.

So, i went ahead with saving it anyways in spite of that error message…It worked
Thank you

1 Like

this trick work for me too…