CSS Conditional Fields on pre-existing Wordpress Form -
i have long memberpress form needs conditional fields. if x checked, field y shown , on.
i've been trying css have been unsuccessful far. can't hack anything. html output memberpress fields. need handle css.
here's html.
<div class="mp-form-row mepr_custom_field mepr_mepr_have_you_taken_the_mccee_exam"> <label for="mepr_have_you_taken_the_mccee_exam" class="mepr-checkbox-field mepr-form-input " > <input type="checkbox" name="mepr_have_you_taken_the_mccee_exam" id="mepr_have_you_taken_the_mccee_exam" /> have taken mccee exam </label> </div> <div class="mp-form-row mepr_custom_field mepr_mepr_date_of_mccee_exam"> <div class="mp-form-label"> <label for="mepr_date_of_mccee_exam">date of mccee exam:</label> <span class="cc-error">date of mccee exam not valid</span> </div> <input type="text" name="mepr_date_of_mccee_exam" id="mepr_date_of_mccee_exam" value="" class="mepr-date-picker mepr-form-input " /> </div> <div class="mp-form-row mepr_custom_field mepr_mepr_mccee_score"> <div class="mp-form-label"> <label for="mepr_mccee_score">mccee score:</label> <span class="cc-error">mccee score not valid</span> </div> <input type="text" name="mepr_mccee_score" id="mepr_mccee_score" class="mepr-form-input " value="" /> </div> what happen this: when clicks checkbox "i have taken mccee exam" want other 2 fields become visible.
i think problem elements in different divs.
here's css i'm trying.
.mepr_mepr_date_of_mccee_exam { display:none } .mepr_mepr_mccee_score { display:none } #mepr_have_you_taken_the_mccee_exam:checked ~ .mepr_mepr_date_of_mccee_exam, #mepr_have_you_taken_the_mccee_exam:checked ~ .mepr_mepr_mccee_score { display:block } i tried few different combinations nothing works. appreciated. i've been @ days.
Comments
Post a Comment