latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

About: Anthony DeNicola

Sorry, I've not written a description yet. I'll get to it soon!


My Favorite Topics

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Required fields not validating

By:  Anthony DeNicola in: Community Forum

voices: 3
replies: 5

3 years, 10 months ago  Cristián Lávaque

Viewing topic 1 (of 1 total)

Topics I'm Subscribed To

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Required fields not validating

By:  Anthony DeNicola in: Community Forum

voices: 3
replies: 5

3 years, 10 months ago  Cristián Lávaque

Viewing topic 1 (of 1 total)

Topics I've Started

Viewing topic 1 (of 1 total)
Topic Count Last Reply
Required fields not validating

By:  Anthony DeNicola in: Community Forum

voices: 3
replies: 5

3 years, 10 months ago  Cristián Lávaque

Viewing topic 1 (of 1 total)

My Latest Replies (From Various Topics)

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Friday Mar 8th, 2013 at 8:17 am #44073

I added the Theme my Login after I wasn’t able to get this working the other day. It added some additional functionality I needed and I couldn’t get the validation working with s2member so I added the custom hack and the Theme my Login script.

Posted: Thursday Mar 7th, 2013 at 2:59 pm #43986

I have Javascript Enabled. All the other scripting on my site works.

On the terms I just set it up as a required checkbox with a tag around the words “Terms and Conditions” so they could be clicked on and someone could still select/deselct the checkbox.

I ended up just modifying my functions file to make the fields required when they are being processed.

It’s not ideal but it works for what I need. Maybe this will help someone else as well:

// Validate First name, Last name, and that user has checked the terms box upon registration
function myplugin_check_fields($errors, $sanitized_user_login, $user_email) {

if ( ! preg_match(‘/^[a-zA-Z\d]+$/’, $_POST[‘ws_plugin__s2member_custom_reg_field_first_name’]) )
$errors->add( ‘first_name_error’, __(‘ERROR: Please enter a valid first name.’,’mydomain’) );

if ( ! preg_match(‘/^[a-zA-Z\d]+$/’, $_POST[‘ws_plugin__s2member_custom_reg_field_last_name’]) )
$errors->add( ‘last_name_error’, __(‘ERROR: Please enter a valid last name.’,’mydomain’) );

if ($_POST[‘ws_plugin__s2member_custom_reg_field_terms’] != “1”)
$errors->add( ‘terms_error’, __(‘ERROR: You must accept the Terms and Conditions.’,’mydomain’) );

return $errors;
}

add_filter(‘registration_errors’, ‘myplugin_check_fields’, 10, 3);

Viewing 2 replies - 1 through 2 (of 2 total)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.