Hi,
I just pushed 1.7.2 which now has a div container around the questions. The class on each div is rsvpAdditionalAttendeeQuestions. Hopefully that will fit your needs.
-Mike
Hi Mike!
It almost did the trick. To use CSS to hide the div directly after the check box I need to use a CSS adjacent sibling selector, and it wouldn’t work right because the checkbox was inside a paragraph instead of “adjacent” to the div.
I was able to get it working by altering the plugin code, which sadly means I’ll need to do this again next time up update plugin.
Essentially I removed the RSVP_START_PARA.
and .RSVP_END_PARA
around:
"<label for=\"rsvpFor".$a->id."\">".
sprintf(__("RSVP for %s ?",'rsvp-plugin'), htmlspecialchars($a->firstName." ".$a->lastName))."</label> ".
"<input type=\"checkbox\" name=\"rsvpFor".$a->id."\" id=\"rsvpFor".$a->id."\" value=\"Y\" />"
in “rsvp_frontend.inc.php”, and making sure to leave the semi-colon.
Then I added the following CSS to my theme:
div.rsvpAdditionalAttendee > input[type=checkbox] + div {
display: none;
}
div.rsvpAdditionalAttendee > input[type=checkbox]:checked + div {
display: block;
}
And now it seems to work as I want it to. When the checkbox isn’t checked, the extra questions are hidden. When checked, the questions show up.
Hi,
Hmm.. this is how I got it to work..
Style change:
.rsvpAdditionalAttendeeQuestions {
display:none;
}
Added some JavaScript into the theme:
jQuery(document).ready(function() {
jQuery("input[name*='rsvpFor']").click(function(event) {
if(jQuery(this).prop('checked')) {
// show
jQuery(this).closest('.rsvpAdditionalAttendee').children('.rsvpAdditionalAttendeeQuestions').show();
} else {
// hide
jQuery(this).closest('.rsvpAdditionalAttendee').children('.rsvpAdditionalAttendeeQuestions').hide();
}
});
})
Well that works great, and with no modifying the plugin code.
Thank you!
Will there be a new update coming soon?
Im having issues with the above and with the spacing with the custom questions.
Nothing is working!
@slsnoots: If you require assistance then, as per the Forum Welcome, please post your own topic.