Log in

View Full Version : Form Field Conditional - Mandatory



igotregistered
04-06-2010, 03:16 PM
Hello,

I would like to ask for assistance with a field I've created. I have the same forum script DD is using. In the ACP of the forum script I created an "Extra Profile Field", ACP>User Profile Fields

It's called "Favorite Team" and it's a mandatory field perspective members must fill out on registration. I added a brief instruction above the field on registration, "Please select your favorite team from this list". The word "list" is a hyperlink to a separate page which has several lists of team options to choose from.

The instruction on the separate page is to highlite and copy the team of their choice, then click the browser "BACK" button to fill in the field. Then continue with registration.


I'm finding these new members aren't following the instructions. They're filling in whatever they want.

What I'd like help with, is to find out if I can add a conditional statement to that field which forces the person to use the list on the other page.

Is this possible?

Thank you, I appreciate your help!

djr33
04-06-2010, 03:52 PM
It's possible but you would have to add some extra programming to the software (using PHP). It would be a little difficult to find the correct place to add the code and also would cause problems with updating the forum software and possibly getting support later. The specific "if" statement wouldn't be that hard though.
This is a question of whether you want to modify the software or not.

igotregistered
04-06-2010, 03:56 PM
Hi, thank you.

I have no plans to upgrade. I'm still back at version 3.7.2. My license membership expired last year and I'm not re-upping. My version won't change.

I've customized several templates with HTML code over the past year or so. I just don't know how to do the statements part.

I also hope this conditional will stop spam bots from autofilling with their garbage to gain access.

Thank you

djr33
04-06-2010, 04:17 PM
It's at a lower level than HTML. This means actually reprogramming the underlying php code that generates the HTML. It's fairly simple if you know php but if you don't will be difficult. As I said the hardest part will be finding the right place to add the code (where the registration form is processed). If you do it the wrong way it may cause the forum not to function, so be careful. (make a backup of the file first and you should be ok though).
All you need is to add an "if (invalid input) { deny registration; }" statement somewhere in the registration process but if you don't already know how to do that I don't recommend you try it, at least without learning some php first.
In his case it's probably best to get someone who knows what they are doing and it would be easy. Perhaps posting in the paid work requests section is a good idea. Give someone temporary access to your FTP and they can look through all the files to find the right spot and add the code.
Alternatively post this on a v bulletin support site because few people here are that familiar with it. They might be able to tell you exactly what to do.

igotregistered
04-06-2010, 04:23 PM
I did post there, Marco replied once saying I could set a pattern that must be matched with the custom profile field. But I have no idea what that means. I asked for a little more info but he didn't reply.

Basically with the vb script there is no editing of the actual php files. The files called actually refer back to templates. The templates are where all the editing takes place inside the vb ACP.

djr33
04-06-2010, 04:48 PM
If vb has an option that may be easy but I don't know about it. I'd suggest looking at the documentation. Of course you can still reprogram it but a method within vb is of course better