Title: Registration form validation
Last modified: August 22, 2016

---

# Registration form validation

 *  [manOmedia](https://wordpress.org/support/users/manomedia/)
 * (@manomedia)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/registration-form-validation-2/)
 * Hi all…
 * I have three related fields in my custom registration form;
    [check box] Do you
   want to receive text messages? [phone#] My cell phone number [provider] My service
   provider
 * During registration and profile updates, when the user selects save or submit,
   I want those fields to be validated so if any of the three have data filled in
   while others do not, an error would pop-up.
 * I am pretty terrible with php but have done a few things.
    I am looking for something
   along the lines of: If $checkbox && empty($phone# or $provider) then error message.
   Or I suppose for more accuracy it could be three elseif statements.
 * The basic questions are, can someone give me or point me to some sample code 
   and more important, where would I put the code? In s2hacks.php?
    In fact I have
   some code which runs during new and modified profiles using: add_action during_paypal_notify_during_subscr_signup_w_update_vars
   add_action during_paypal_notify_during_subscr_modify
 * If s2hacks.php, would I create another function within the same add_action section
   or would this be a completely new section?
 * fyi, I am running S2member pro.
    Many thanks, DP
 * [https://wordpress.org/plugins/s2member/](https://wordpress.org/plugins/s2member/)

The topic ‘Registration form validation’ is closed to new replies.

 * ![](https://ps.w.org/s2member/assets/icon-256x256.png?rev=980067)
 * [s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions](https://wordpress.org/plugins/s2member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/s2member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/s2member/)
 * [Active Topics](https://wordpress.org/support/plugin/s2member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/s2member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/s2member/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [manOmedia](https://wordpress.org/support/users/manomedia/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/registration-form-validation-2/)
 * Status: not resolved