We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Profile Fields on Registration Edit
Topic Started: Aug 28 2012, 07:07 PM (785 Views)
lonewolfe2015
Member Avatar
Member
[ *  * ]
Board Address: http://w11.zetaboards.com/The_Javahouse_League/index/
Board Software: Zeta
Description:

When you register with Zetaboards there is no option to make a profile field required nor is there an option to add a Description below the field to explain why it is required or how to input the information. So if you use one of the profile extension mods which require precise inputs to get the right linked icon, you need the people to register appropriately.

Is there a way to A: Make fields required rather than optional upon registration and B: Add a smaller text description below a profile field on registration to perhaps add example text or a description?
Offline Profile Goto Top
 
Ferby
Member Avatar
Developer
[ *  *  *  *  * ]
Heres the code to make required fields: http://resources.zetaboards.com/topic/5154621
Offline Profile Goto Top
 
lonewolfe2015
Member Avatar
Member
[ *  * ]
Ferby
Aug 28 2012, 07:16 PM
Heres the code to make required fields: http://resources.zetaboards.com/topic/5154621
Everytime I miss something like this I feel a lot less intelligent.

But thanks, hopefully Cory or someone else can come in and save the day on finding an easy solution to adding descriptions below profile fields :)
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Code:
 
<script type="text/javascript">
function addField(fieldName, description) {
$('table.register').find('td.c_desc:contains(' + fieldName + ') + td').append('<br /><small>' + description + '</small>');

$('table.register').closest('form').submit(function (e) {
var input = $('td.c_desc:contains(' + fieldName + ') + td input, td.c_desc:contains(' + fieldName + ') + td textarea').val();

if (input.length === 0) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Please fill out the requires fields, required fields are denoted with an asterisk (*)').one();
}
});
}

addField('FIELD_NAME', 'DESCRIPTION');
</script>
Try that instead.
Offline Profile Goto Top
 
lonewolfe2015
Member Avatar
Member
[ *  * ]
http://w11.zetaboards.com/The_Javahouse_League/register/?c=1

Code:
 
<script type="text/javascript">
function addField(fieldName, description) {
$('table.register').find('td.c_desc:contains(' + fieldName + ') + td').append('<br /><small>' + description + '</small>');

$('table.register').closest('form').submit(function (e) {
var input = $('td.c_desc:contains(' + fieldName + ') + td input, td.c_desc:contains(' + fieldName + ') + td textarea').val();

if (input.length === 0) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Please fill out the requires fields, required fields are denoted with an asterisk (*)').one();
}
});
}

addField('Alliance', 'Fill this in exactly as it appears in-game, e.g. The Javahouse League');
addField('Nation ID', 'Fill this in exactly as it appears at the end of your nation's URL link, e.g. 333128');
</script>


Didn't prevent registration nor add the description. Tried moving it to the top of the template in case another code was blocking it too.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
You need to escape the apostrophe.
Code:
 
nation's
Change that to this:
Code:
 
nation\'s
Offline Profile Goto Top
 
lonewolfe2015
Member Avatar
Member
[ *  * ]
The backslash fixed the code, but the asterik portion is not functioning on the registration screen. It will require the profile fields, show the information string, but not star the field.

Thanks btw Cory, really appreciate this.
Offline Profile Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
Sorry about that, try this instead:
Code:
 
<script type="text/javascript">
function addField(fieldName, description) {
$('table.register').find('td.c_desc:contains(' + fieldName + ')').prepend('*');
$('table.register').find('td.c_desc:contains(' + fieldName + ') + td').append('<br /><small>' + description + '</small>');

$('table.register').closest('form').submit(function (e) {
var input = $('td.c_desc:contains(' + fieldName + ') + td input, td.c_desc:contains(' + fieldName + ') + td textarea').val();

if (input.length === 0) {
e.returnValue = e.preventDefault && e.preventDefault() ? false : false;
alert('Please fill out the requires fields, required fields are denoted with an asterisk (*)').one();
}
});
}

addField('Alliance', 'Fill this in exactly as it appears in-game, e.g. The Javahouse League');
addField('Nation ID', 'Fill this in exactly as it appears at the end of your nation\'s URL link, e.g. 333128');
</script>
Offline Profile Goto Top
 
lonewolfe2015
Member Avatar
Member
[ *  * ]
Perfect, thanks again Cory.
Offline Profile Goto Top
 
Steve
Member Avatar
patriot
[ *  *  *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic