I’m having some trouble. I’m trying to add a class according to what value the option selected has.
I thought this would work.
if ($("input#field_24").val() == "patient") {
$("div[id*='-form'] input#field_25").addClass(" required");
}
EDIT
Sorry to have added a similar question. This answered mine.
Thanks!
If you’re using selected options, you’re not dealing with an input field, it’d be
select#field_24.If you’re using radios:
$input#field_24:checked.If you need the
VALUEof the selected option in a select field:select#field_24:selected