Custom Field Required for Non-Members - Terms of Service

Hello, I have set-up a custom field for the registration of a check-box for terms of service agreement. I have set the Required to Yes, however, this says it only affects existing members which is unusual since this is for a registration box. How do I have this custom field required for non-members?

Additionally, I have paypal buttons on my pricing page. Am I able to have this same custom field for the Terms of Service agreement attached to the paypal button, in other words, to be required to be checked before a non-member can click the paypal button and pay?

Thank you!

Does anyone have any suggestions for this? Please help. Thank you

Where does it say it affects only existing members? I have a similar checkbox and it works for every new registration. (I even just checked to make sure!)

General Options > Registration Profile Fields & Options > Edit a Custom Field > Field Required*

It says under Field Required:
If yes, only Users/Members will be “required” to enter this field.

  • Administrators are exempt from this requirement.

I understand my misinterpretation of this now that is means everything registering for an account other than admin will be required to check it but it doesn’t require it when I test.

While you are correct, the custom check box works and is visible, when I test the box by registering a new profile, the check box is there and I can click it, however, I am able to register the new account WITHOUT checking it.

I want it set-up so that a new registration can only be submitted if the box is checked.

Mine works just as you want yours to. This is what I did. I created a form with custom fields just like you have done. But I wanted to add all sorts of other notation (mainly for accessibility purposes) so, while logged out, I then went to where I had put the checkout/registration form shortcode. Then I right-clicked and selected View Page Source and then copied the html that appeared there from <div id="s2p-form"> to </form> inclusive.

Then I created a file in my theme’s folder, called it either stripe-checkout-form.php or stripe-registration-form.php and pasted in the code I had copied. Then I put this code block above it:

<?php
// @codingStandardsIgnoreFile
if ( !defined( 'WPINC' ) ) // MUST have WordPress.
	exit( 'Do not access this file directly.' );
?>

Now you can do what you like with the form. To get what you want, find the line that begins with <input type="checkbox" and simply add required just before />

Thank you very much for your help. While I ended up doing it differently, you helped me find what I needed.

I edited the s2member custom-reg-fields.inc.php file and the theme log login registration php file directly.

I removed the “aria-” so that it just reads "required=“true” and this brings a little pop up that says Select this checkbox which has to be completed before submitting, which is the action I wanted.

Thank you again! I really appreciate your help.

Glad to help! Just bear in mind that your method means that your changes will get overwritten by any future update to s2Member, so do keep a copy of them!!

Hm yes, that is true! Thank you for the reminder.

I was unsure how to do it your way since I’m using the two plugins, s2member and Theme My Login for the registration page, unless you have guidance for a more permanent way with them?

Sorry, but in that case I can’t offer more guidance because I don’t use Theme My Login. All my registrations are done by using custom s2Member Pro forms.