The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Add javascript button to VB registration page
I'm trying to figure out how to add a button to the registration page that will run some javascript when clicked on.
Is there some option in the vb control panel that allows this, or do I have to modify some files or something? Any help is greatly appreciated |
#2
|
|||
|
|||
Hello There,
I would love to help you! If it is a javascript and includes no php then you can simply do this through the Vbulletin control panel. Please navigate yourself to the "Styles & Templates" and click on "Search in Templates". You want to search for "register" and search in the template which is primary. Scroll through until you see a template file with the name "register". Double click and add your javascript code in the desired positions. Hope that helps, let me know if you have any issues! |
#3
|
||||
|
||||
<a href="http://www.vbulletin.com/docs/html/styles_and_templates" target="_blank">The manual also talks about styles and templates.</a>
|
#4
|
|||
|
|||
Thank you both for your help this far. Now another question
I created 2 new textboxes via the template. Is there a way I can save the information the user enters in these textboxes to the users database? I thought about editing the register.php file but then a vBulletin update might break my custom code? |
#5
|
||||
|
||||
What you are probably looking for is a custom profile field - again, have a look in the manual for that.
|
#6
|
|||
|
|||
Thanks, I actually knew about the custom user fields but didn't think to work my javascript around them.
Now one last question until I have this small project completed (and I did look in the manual but couldn't find help on it!): When a user is registering, is it possible to check a custom field to see if another user already has the value in that field? I don't want any 2 users having the same value in the custom field I created. |
#7
|
||||
|
||||
To do that, you will need to add a plugin to check the fields, and spit an error if needed. The hook you probably want is userdata_presave.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|