-
Author
-
January 8, 2014 at 21:16 #9392frien337Participant
Hello Everyone,
I don’t want my user to have to provide their name. Is there a way that I can disable this field or even make it non mandatory?
Thanks,
RyanJanuary 10, 2014 at 10:37 #9485AbeKeymasterHi, You can add this script in footer.php just before wp_footer line. This will hide the full name in the register page and because it is a require field it will take the value of username
COPY CODE<script> var url = document.location.href; jQuery(document).ready(function() { //copy profile name to account name during registration if (url.indexOf("register/") >= 0) { jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none'); jQuery('#signup_username').blur(function(){ jQuery("#field_1").val(jQuery("#signup_username").val()); }); } }); </script>
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 10, 2014 at 19:33 #9533frien337ParticipantThanks Abe, this has worked perfectly. I just had to make a small change by adding in a “/” before the “register/” text. Here’s the updated one for anyone who needs this:
COPY CODE<script> var url = document.location.href; jQuery(document).ready(function() { //copy profile name to account name during registration if (url.indexOf("/register/") >= 0) { jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none'); jQuery('#signup_username').blur(function(){ jQuery("#field_1").val(jQuery("#signup_username").val()); }); } }); </script>
January 11, 2014 at 16:11 #9558frien337ParticipantHi Abe,
It doesn’t seem to be working 100% correctly. That bit of code has hidden the full name field just fine but when I try to register I still get a message saying “This is a required field” where the name field is hidden. any more ideas? 🙂
If you need to see my registration page you can do so at:
http://www.friendsireland.com/niam/
This is the default page without the code you have provided me with.Thanks,
RyanJanuary 11, 2014 at 16:13 #9560frien337ParticipantJust realised my 2nd reply messed up when I pasted the code into this forum; it should have liked this:
<script>
var url = document.location.href;
jQuery(document).ready(function() {
//copy profile name to account name during registration
if (url.indexOf("register/") >= 0) {
jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none');
jQuery('#signup_username').blur(function(){
jQuery("#field_1").val(jQuery("#signup_username").val());
});
}
});
</script>
January 12, 2014 at 19:54 #9595AbeKeymasterHi, Should have used my initial code because now the javascript is probably not applying and not copying your username to your full name field
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 13, 2014 at 12:04 #9643frien337ParticipantThanks Abe, however, I don’t think that is the problem because I still get the same result when using your code.
Is there any other ideas that you may have?
Thanks,
RyanJanuary 14, 2014 at 11:33 #9704AbeKeymasterTry without the register condition and see if it works
jQuery(document).ready(function() { //copy profile name to account name during registration
jQuery('label[for=field_1],#field_1, #field-visibility-settings-toggle-1').css('display','none'); jQuery('#signup_username').blur(function(){ jQuery("#field_1").val(jQuery("#signup_username").val()); });
});
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer. -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.