Statistics: Posted by man-O-media — October 1st, 2011, 10:20 pm
<?php
add_action ("wp_head", "s2_hacks_js", 15);
function s2_hacks_js()
{
echo '<script type="text/javascript">';
include_once dirname (__FILE__) . "/s2-hacks.js";
echo '</script>';
}
?>
Statistics: Posted by Jason Caldwell — October 1st, 2011, 9:59 pm
In Pro Forms, Custom Registration Fields are prefixed by:depending on the type of Pro Form being integrated.
- Code:
s2member-pro-paypal-[checkout|sp-checkout|registration]-custom-reg-field-
jQuery(document).ready (function($)
{
/* This line works in the default wp registration form. */
if (!$.trim ($ ('input#ws-plugin--s2member-custom-reg-field-city').val ()))
$('input#ws-plugin--s2member-custom-reg-field-city').val ('New York');
/* This line does not work in the pro registration form. */
if (!$.trim ($('input#s2member-pro-paypal-registration-custom-reg-field-city').val ()))
$('input#s2member-pro-paypal-registration-custom-reg-field-city').val ('New York');
/**/
/* Sets the default value of preferred_contact_number to the value being entered for home_phone_number. */
$('input#ws-plugin--s2member-custom-reg-field-primary-phone').keyup (function() /* Key press. */
{
$('input#ws-plugin--s2member-custom-reg-field-calling-post-phone').val ($ (this).val ());
});
});
<?php
add_action ("login_head", "s2_hacks_js", 15);
function s2_hacks_js()
{
echo '<script type="text/javascript">';
include_once dirname (__FILE__) . "/s2-hacks.js";
echo '</script>';
}
?>
Statistics: Posted by man-O-media — October 1st, 2011, 9:46 pm
s2member-pro-paypal-[checkout|sp-checkout|registration]-custom-reg-field-
jQuery(document).ready (function($)
{
/* Sets default value of home_phone_number to: 999-999-9999. */
if (!$.trim ($('input#s2member-pro-paypal-registration-custom-reg-field-home-phone-number').val ()))
$('input#s2member-pro-paypal-registration-custom-reg-field-home-phone-number').val ('999-999-9999');
/**/
/* Sets the default value of preferred_contact_number to the value being entered for home_phone_number. */
$('input#s2member-pro-paypal-registration-custom-reg-field-home-phone-number').keyup (function() /* Key press. */
{
$('input#s2member-pro-paypal-registration-custom-reg-field-preferred-contact-number').val ($(this).val ());
});
});
Statistics: Posted by Jason Caldwell — October 1st, 2011, 4:51 pm
Jason Caldwell wrote:* This code assumes that you're using the default Login/Registration system for WordPress ( i.e. /wp-login.php?action=register )
jQuery(document).ready (function($)
{
/* Sets default value of home_phone_number to: 999-999-9999. */
if (!$.trim ($ ('input#ws-plugin--s2member-custom-reg-field-home-phone-number').val ()))
$('input#ws-plugin--s2member-custom-reg-field-home-phone-number').val ('999-999-9999');
/**/
/* Sets the default value of preferred_contact_number to the value being entered for home_phone_number. */
$('input#ws-plugin--s2member-custom-reg-field-home-phone-number').keyup (function() /* Key press. */
{
$('input#ws-plugin--s2member-custom-reg-field-preferred-contact-number').val ($ (this).val ());
});
});
Statistics: Posted by man-O-media — September 27th, 2011, 10:59 pm
Statistics: Posted by man-O-media — August 19th, 2011, 1:36 pm
Statistics: Posted by Jason Caldwell — March 30th, 2011, 11:42 pm
I've just done a video on this code for you.
Please let us know if you continue to have trouble.
Statistics: Posted by man-O-media — March 27th, 2011, 10:43 am
Statistics: Posted by Jason Caldwell — March 27th, 2011, 3:17 am
So it's relatively easy ( for a developer ) to use jQuery for this, by adding a Hook in the following way.
Statistics: Posted by man-O-media — March 27th, 2011, 2:26 am
<?php
add_action ("login_head", "s2_hacks_js", 15);
function s2_hacks_js ()
{
echo '<script type="text/javascript">';
include_once dirname (__FILE__) . "/s2-hacks.js";
echo '</script>';
}
?>
jQuery(document).ready (function($)
{
/* Sets default value of home_phone_number to: 999-999-9999. */
if (!$.trim ($ ('input#ws-plugin--s2member-custom-reg-field-home-phone-number').val ()))
$('input#ws-plugin--s2member-custom-reg-field-home-phone-number').val ('999-999-9999');
/**/
/* Sets the default value of preferred_contact_number to the value being entered for home_phone_number. */
$('input#ws-plugin--s2member-custom-reg-field-home-phone-number').keyup (function() /* Key press. */
{
$('input#ws-plugin--s2member-custom-reg-field-preferred-contact-number').val ($ (this).val ());
});
});
Statistics: Posted by Jason Caldwell — March 23rd, 2011, 1:01 am
Statistics: Posted by Cristián Lávaque — March 23rd, 2011, 12:08 am
Statistics: Posted by man-O-media — March 22nd, 2011, 8:09 pm