Author |
Topic |
|
Jeepers Ron
New Member
USA
95 Posts |
Posted - 20 November 2002 : 20:56:54
|
Does anyone know how to make other information required before you can complete a new user registration?
Such as:
- First name - Age - Sex - Location |
Jeeper from Michigan
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 20 November 2002 : 21:37:31
|
Just as it is done with the other required fields. For example this is the way the password is tested to verify that it is not blank, or greater than 25 chars in length, or that the first password specified is identical to the second (code in register.asp):
if trim(Request.Form("Password")) = "" then
Err_Msg = Err_Msg & "<li>You must choose a Password</li>"
end if
if Len(Request.Form("Password")) > 25 then
Err_Msg = Err_Msg & "<li>Your Password can not be greater than 25 characters</li>"
end if
if Request.Form("Password") <> Request.Form("Password2") then
Err_Msg = Err_Msg & "<li>Your Passwords didn't match.</li>"
end if
For your case the tests to be done need to be similar to the first one here, that his ensure that the fields are not blank after removing leading and trainling spaces with Trim. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Jeepers Ron
New Member
USA
95 Posts |
Posted - 21 November 2002 : 08:57:16
|
Thanks for your help ruirib, I had to update a couple of files to get this to work right, register.asp and inc_profile.asp
Here are the changes I’ve made, if anyone is interested in adding this feature to your forum.
register.asp Added code, Just like you said if trim(Request.Form("Firstname")) = "" then Err_Msg = Err_Msg & "<li>You must choose a first name</li>" end if
if Len(Request.Form("Firstname")) > 25 then Err_Msg = Err_Msg & "<li>Your first name can not be greater than 25 characters</li>" end if
inc_profile.asp Modified code: This adds the ( * ) next to the required information feilds. From strDefaultFontSize & """>Firstname: </font></b></td>" & vbNewLine & _ to this strDefaultFontSize & """>* Firstname: </font></b></td>" & vbNewLine & _
if strFullName = "1" then Response.Write " <tr>" & vbNewLine & _ " <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>* Firstname: </font></b></td>" & vbNewLine & _
Thanks again, I love working on this forum. |
Jeeper from Michigan
|
Edited by - Jeepers Ron on 21 November 2002 09:06:13 |
|
|
Kent
Junior Member
United States
193 Posts |
Posted - 21 November 2002 : 10:40:00
|
Thanks, Ron. That's quite helpful.
I think a true mod with an admin setup screen to select which additional fields to make mandatory would be a GREAT mod and a good potential candidate to go in the base Snitz code at some future point.
The problem with hard-coding all these tweaks comes from the frequent need to upgrade the code -- not just major new versions or SRs, but also the rounds of security fixes we just went through with v3.3... |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
LanKuchang
Junior Member
Malaysia
120 Posts |
Posted - 21 November 2002 : 20:05:29
|
Ron, thank you so much. you've made it plain simple for me to do just that.. make some required fields. I went through adding few fields for my forum which was very tedious and looking around how to make them required.
i'm not a programmer so i really rely on this forum to help me setup my own forum.
like you said.. it's great working with snitz |
|
|
randykirkpatrick
New Member
73 Posts |
Posted - 21 November 2002 : 22:28:16
|
Looks good but one question where in the register.asp do I add it. Say for the gender or age. Does it need to be in a certin place or just at the top of the page? Also if you can't tell by now I'm not a coder...LOL |
Thank you Randy K |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 21 November 2002 : 22:32:16
|
Just make the code that checks for the value appear in the order the field being tested appears, as well. So, add that after the existing verification code. Of course, you could use any order you want, but probably it will be cleared this way. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
|
Topic |
|