PDA

View Full Version : Pre-checked custom profile field


licensinglinks
08-11-2012, 04:38 AM
I want to set up a checkbox custom profile field "Receive weekly digest" (like the default "Receive Email from Administrators" field). I want this to display at registration and to be pre-checked.

Is this possible?

Lynne
08-11-2012, 02:53 PM
Is it possible? Of course - anything is possible if you code it. If you are wondering if it already exists as a modification, then I would ask if you have tried a search yet? I do not know of a mod for this offhand.

licensinglinks
08-16-2012, 08:11 PM
Yes I have tried a search.

Anyone got any ideas how I can do it?

Lynne
08-16-2012, 08:16 PM
Create a User Profile Field, set it up to show at registration, and set the default for it to be checked. https://www.vbulletin.com/docs/html/profile

(Sorry, at first I thought you were asking about something else.)

licensinglinks
08-16-2012, 08:29 PM
Create a User Profile Field, set it up to show at registration, and set the default for it to be checked. https://www.vbulletin.com/docs/html/profile
You can't do that with checkboxes!

Lynne
08-16-2012, 08:59 PM
Why not use a single-selection radio button with Yes/No as the answer and preset it to Yes? Your other option is for you to custom code it.

licensinglinks
08-18-2012, 08:11 PM
Why not use a single-selection radio button with Yes/No as the answer and preset it to Yes? Your other option is for you to custom code it.

Yes I could do this, but I want to know if I can do it with a pre-checked checkbox instead. That solution would be much neater.

Lynne
08-18-2012, 11:47 PM
You cannot do it using the user profile fields. You would need to custom code it if you want it prechecked.

Another option is do do the opposite - instead of "Check if you wish to receive a weekly site newsletter", go with "Check if you do NOT wish to receive the weekly site newsletter".

licensinglinks
08-19-2012, 07:54 AM
You would need to custom code it if you want it prechecked.

That's what I want to know. Can anyone explain how to do it? I'm not looking for alternative ideas - I'm aware of the other options.

Black Snow
08-19-2012, 11:06 AM
The code for making the box would be something like:
<input type="checkbox" name="digest" value="Yes" checked="checked" />

As for implementing it into vB, that's another story.

Lynne
08-19-2012, 04:28 PM
As for implementing it into vB, that's another story.
Yep, it's going to be quite a bit of effort. If you don't know how to code, then I suggest your post in the Paid Requests forum to hire someone. You need to add the item to all the right templates, add a database field, and modify all forms that deal with the field.