Hello,
I would like to create a registration form with a choice.
I would like to let people on the same level register
• with children
• who don’t have.
(all this is free no paypal)
All have the same access to content, and therefore, the same level.
If they have children
• there would be some info required,
but if they don’t,
• the fields should be hidden.
Someone already posted a similar issue.
You suggested to build a custom template
(http://www.s2member.com/forums/topic/customizing-custom-registrationprofile-field/)
Should I place the php for the query in the template?
Sorry if this is a stupid question but I am a bit lost.
Or, I could maybe hide a whole section of custom fields via css or jQuery
and onClick display the hidden section.
It doesn’t seem to be a clever solution;(….
But I am searching for several days now and have no idea how to realize.
I would suggest that you create ALL of your Custom Registration/Profile Fields in s2Member (including those which you may or may NOT collect, based on the way a particular form is being filled out; i.e. has children or not).
Next, I would implement some custom JavaScript that manipulates the form to accomplish this dynamically. This way you can hide/show certain form fields, based on HOW the form has been filled out thus far.
s2Member works from the aria-required attribute. So if you need to suppress JavaScript validation on form fields that you’re NOT planning to require, you can simply set the form field attribute aria-required="false" through your own custom JavaScript routines.
For example, if having no children indicates that form fields x,y,z do NOT need to be filled in, your custom JavaScript can hide those fields from view, and also set the aria-required="false" attribute. You set that attribute on the form field itself, and NOT on the containing div element that holds the field.
That’s certainly an option as well, and that would be just a good. Possibly more work, but you will have even more control over things this way. Yes, you can place any custom code right into your custom template file.
Thank you very much for your detailed and helpful answer.
Special thanks for the aria-required attribute hint.
I will try what works for me best.
I am pretty relieved that I am heading in the right direction.
Thanks a lot.
Viewing 2 replies - 1 through 2 (of 2 total)
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.