Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Not Reading field correctly...help?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

JBaldwin
Junior Member

USA
137 Posts

Posted - 14 July 2006 :  11:40:19  Show Profile
Ok...this wasnt really a mod to begin with, but I need help. I added a field into MEMBERS table called M_LEAGUE. 3 values can be entered into this field, either a "Yes", "No" or null.

Now, in default the value is null. If someone changes it to "Yes" or "No" by choosing a Yes or No with a SELECT DROP DOWN when editing their profile, it will update the database. If they then go back in to edit their profile at a later time, the code (inc_profile.asp) should read the field...if it is "Yes" then the "Yes" SELECT BOX should be selected, if "No" then the "No" SELECT BOX should be selected.

The snippet of code I am trying to use is not that long, so I am going to post it below. Does anyone see any fault in the code or someting I am missing? Any help would be appreciated. If you wish to see it in action and want to test it out, log in and edit the profile:

Username: test
Password: test

THE SNIPPET FROM inc_profile.asp:



  		Response.Write " <tr>" & vbNewLine & _
					"                      <td align=""center"" bgcolor=""" & strCategoryCellColor & """ colspan=""2""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """> Betfred Friday Night League </font></b></td>" & vbNewLine & _
					"                    </tr>" & vbNewLine
			Response.Write	"                    <tr>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Signed Up? : </font></b></td>" & vbNewLine & _
					"                      <td bgColor=""" & strPopUpTableColor & """ align=""left""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>"
			if strMode <> "Register" then Response.Write(ChkString(rs("M_LEAGUE"), "display"))
			Response.Write	"</font></td>" & vbNewLine & _
					"                    </tr>" & vbNewLine
			Response.Write	"                    <tr>" & vbNewLine & _
					"                <td align=""right"" bgColor=""" & strPopUpTableColor & """><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Want To Sign Up?</b></font></td>" & vbNewLine & _
					"                <td align=""left"" bgColor=""" & strPopUpTableColor & """>" & vbNewLine & _
					"                <select name=""League"">" & vbNewLine & _
					"                      	<option value=""Yes"""
			if rs("M_LEAGUE") = "Yes" then Response.Write(" selected")
			Response.Write	">Yes</option>" & vbNewLine & _
					"                      	<option value=""No"""
			if rs("M_LEAGUE") = "No" OR "" then Response.Write(" selected")
			Response.Write	">No</option>" & vbNewLine & _
					"                      </select>" & vbNewLine & _
					"				 </td></tr>"



AbsolutelyFreerolls.com - Poker Freeroll Listings, Poker Forum and Poker News


MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 14 July 2006 :  15:40:53  Show Profile  Visit MarcelG's Homepage
Tip : Do a response.write of rs("M_LEAGUE") in between, to check and see what the real value of it is.

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

JBaldwin
Junior Member

USA
137 Posts

Posted - 14 July 2006 :  17:21:58  Show Profile
Did the Response.Write; It is showing the correct value ("Yes") or ("No")

EDIT: I adjusted the
If...Then
to this:

			if (rs("M_LEAGUE") = "Yes") then Response.Write(" selected")
			Response.Write	">Yes</option>" & vbNewLine & _
					"                      	<option value=""No"""
			if (rs("M_LEAGUE") <> "Yes")   then Response.Write(" selected")
			Response.Write	">No</option>" & vbNewLine & _


It is working fine now. Thanks Marcel.

AbsolutelyFreerolls.com - Poker Freeroll Listings, Poker Forum and Poker News



Edited by - JBaldwin on 14 July 2006 17:27:21
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 14 July 2006 :  17:29:34  Show Profile  Send ruirib a Yahoo! Message
This line:

if rs("M_LEAGUE") = "No" OR "" then Response.Write(" selected")

is not correct.
Should be:

if rs("M_LEAGUE") = "No" OR rs("M_LEAGUE") = "" then Response.Write(" selected")

Personally I don't even like to use this operator to compare strings.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

JBaldwin
Junior Member

USA
137 Posts

Posted - 14 July 2006 :  17:52:00  Show Profile
What would you recommend using?

AbsolutelyFreerolls.com - Poker Freeroll Listings, Poker Forum and Poker News


Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 14 July 2006 :  18:03:09  Show Profile  Send ruirib a Yahoo! Message
You can do that, it's done like that in the Snitz code quite a few times.
I normally use StrComp.

Anyway, your mistake, as it seems to me, was the coding of the OR of the two conditions.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07