Author |
Topic |
cassie
Starting Member
USA
9 Posts |
Posted - 03 January 2006 : 15:27:38
|
Is there any way I can make the First Name and Surname required fields when new users register?
I went into the code and added the asterisk, but I don't want them to be able to submit the form until they have put something in these fields.
Any thoughts? Is there a mod for this? |
|
Ranko
Junior Member
400 Posts |
|
endomorph
Junior Member
United Kingdom
128 Posts |
Posted - 06 January 2006 : 02:13:42
|
Cassie,
In register.asp, look for -
if trim(Request.Form("Country")) = "" then
Err_Msg = Err_Msg & "<li>You must select a country</li>"
end if
After this, enter -
if trim(Request.Form("FirstName")) = "" then
Err_Msg = Err_Msg & "<li>You must enter a first name</li>"
end if
if trim(Request.Form("LastName")) = "" then
Err_Msg = Err_Msg & "<li>You must enter a last name</li>"
end if
The same applies to any other fields you want as required. |
Need help with your Snitz ? Most Snitz & ASP custom coding undertaken. Email for info | Search Engine Optimisation |
|
|
nmstough
Starting Member
7 Posts |
Posted - 13 January 2006 : 16:04:21
|
I must be missing something but I did a search and I dont see anything about the Country field being required in register.asp. Also, where in this file can one add the asterisk (*) to the table where the form fields are located? |
|
|
505_medic
New Member
USA
54 Posts |
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 20 June 2007 : 20:45:22
|
I would like to try and add a twist to this. As a security measure for my forum is there any way to stop someone editing the first and last name fields once they have been submitted? I want these only accessible to admin and they will be hidden fields not shown in profiles. |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 21 June 2007 : 05:17:38
|
Well i have searched and played with code all day, learning more as i go but i'm still not getting the required result. I have renamed fields, changed the order of them and made fields required etc BUT i cant work out the rest. All attempts have failed when i check the profiles. I would like to make Real Name and phone number only visible to admin, mods and the actual user. They are all required fields except phone number until i have worked out how to hide it. Once this info is in place i also want to lock those fields so they can only be edited by Admin. I'm probably asking alot combining the 2? I found a thread here where Shaggy points out the changes to hide fields but when i do a test one my fields are not hidden at all even when viewing a profile with a non admin account. I tried hiding occupation as a test by doing the following but it didn't work.
if strOccupation = "1" then Response.Write " <tr>" & vbNewLine & _ " <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Occupation: </font></b></td>" & vbNewLine & _ " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input type=""hidden"" name=""Occupation"" size=""25"" maxLength=""255"" value=""" if strMode <> "Register" then Response.Write(ChkString(rs("M_OCCUPATION"), "display")) Response.Write """></font></td>" & vbNewLine & _ " </tr>" & vbNewLine end if |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 21 June 2007 : 07:50:54
|
I must be doing something wrong somewhere or is there something othewr than inc_profile i have to edit? This is the code just to work it out on occupation and it's not working.
if strOccupation = "1" and mlev > 3 then Response.Write " <tr>" & vbNewLine & _ " <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Occupation: </font></b></td>" & vbNewLine & _ " <td bgColor=""" & strPopUpTableColor & """><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""Occupation"" size=""25"" maxLength=""255"" value=""" if strMode <> "Register" then Response.Write(ChkString(rs("M_OCCUPATION"), "display")) Response.Write """></font></td>" & vbNewLine & _ " </tr>" & vbNewLine end if |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 21 June 2007 : 08:26:03
|
I did a search but i only have 1 place with it. I have placed that code in if strFullName = "1" and mlev > 3 then and if strCity = "1" and mlev > 3 then as these are the 2 main ones i want to hide. The city field is going to be phone number once the hidden field is working. Both these strFullName and strCity only return 1 search result each in inc_profile and this is on 3.4.06 |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 21 June 2007 : 08:48:19
|
hmmmmm dont know whats going wrong then. Had other members check too and it hasnt changed anything. |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
|
secretsquirrel
New Member
Australia
81 Posts |
Posted - 21 June 2007 : 09:18:34
|
Thanks for your help with this
http://www.aussiecoins.net/inc_profile.txt |
Anyone who says a square peg does not fit into a circular hole has never seen a crazy bítch with a hammer |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 21 June 2007 : 09:46:53
|
Sorry for misleading you, you need to edit pop_profile.asp, not inc_profile.asp. For fullname, the line should look like this:
if strFullName = "1" and mlev > 3 and (Trim(rs("M_FIRSTNAME")) <> "" or Trim(rs("M_LASTNAME")) <> "" ) then
Just add the red part and it should fix it. It's a similar change for City. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
|
|
Topic |
|