|
| |
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
"if then" help - 12/4/2003 16:15:41
i'm trying to say .. if field name contains anything then display this text and link to this field name. But I'm not as familiar with this stuff as I want to be, hence I sak for help! I have: <%
if FP_FieldVal(fp_rs,"fieldname") = "" then
response.write "<a href="<%=FP_FieldLink(fp_rs,"fieldname?www.leisure-ideas.com" target="_blank"><font size="1" face="Verdana">Visit Web Site</font></a>"
else
'do something for NO
end if
%>
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: "if then" help - 12/4/2003 19:20:05
Change this line: if FP_FieldVal(fp_rs,"fieldname") = "" then to this if FP_FieldVal(fp_rs,"fieldname") <> "" then Not sure what you are trying to do in the response.write. Where exactly do you want to redirect to?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Richard Dudley
Posts: 668 Joined: 8/22/2002 From: Butler, PA Status: offline
|
RE: "if then" help - 12/4/2003 21:18:49
Try this: quote:
<% if FP_FieldVal(fp_rs,"fieldname") = "" then response.write("<a href=" & FP_FieldLink(fp_rs,"fieldname?www.leisure-ideas.com" target="_blank"> & "<font size='1' face='Verdana'>Visit Web Site</font></a>") else 'do something for NO end if %> Your main traps here are the double quotes and the & (concatenation) operator. You also had the <%= (reponse.write) operator inside of a response.write.
_____________________________
I need to change my avatar--the puppy is full grown now!
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: "if then" help - 12/5/2003 8:57:44
quote:
but now trying to change the image to a text hyperlink And you just want to link to www.leisure-ideas.com? See if this works. <% if FP_FieldVal(fp_rs,"CardsAcceptedDiners") = "yes" then response.write "<a href=""http://www.leisure-ideas.com""><font size=""1"" face=""Verdana"">Visit Web Site</font>" else 'do something for NO end if %>
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: "if then" help - 12/5/2003 9:50:12
yeah that works but it still doesn't work with an FP LINk like: <%
if FP_FieldVal(fp_rs,"Web Site") <> "" then
response.write "<a href="FP_FieldLink(fp_rs,"Web Site")& "?www.leisure-ideas.com""><font size=""1"" face=""Verdana"">Visit Web Site</font>"
else
'do something for NO
end if
%> the actaul link is in the field name "Web Site". the "?www.leisure-ideas.com" is to load the link with a referrer ID.
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: "if then" help - 12/5/2003 10:00:38
What would a sample link look like in regular html?
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: "if then" help - 12/5/2003 10:02:33
http://www.datafromfield.com?www.leisure-ideas.com
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: "if then" help - 12/5/2003 11:19:19
I think you are close. Can you get it to work without the referrer information first? In other words, does this work? response.write "<a href=""FP_FieldLink(fp_rs,"Web Site")""><font size=""1"" face=""Verdana"">Visit Web Site</font>" You may have to play with the double quotes a bit. I admit I am not as proficient as others that frequent this particular forum. The reason I ask if you can get it to work without the referrer is I am wondering if you will run into the problem mention in this thread: http://www.frontpagewebmaster.com/m-167380/tm.htm
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: "if then" help - 12/5/2003 11:22:36
quote:
ORIGINAL: betheball I think you are close. Can you get it to work without the referrer information first? In other words, does this work? response.write "<a href=""FP_FieldLink(fp_rs,"Web Site")""><font size=""1"" face=""Verdana"">Visit Web Site</font>" You may have to play with the double quotes a bit. i can get it to work like this: response.write "<a href=""?www.leisure-ideas.com""><font size=""1"" face=""Verdana"">Visit Web Site</font>" but nothing with FP FieldVal
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
rdouglass
Posts: 9270 From: Biddeford, ME USA Status: offline
|
RE: "if then" help - 12/5/2003 11:34:33
quote:
response.write "<a href=""FP_FieldLink(fp_rs,"Web Site")""><font size=""1"" face=""Verdana"">Visit Web Site</font>" Try using just FP_Field and use it like this: response.write("<a href=" & FP_Field(fp_rs,"Web Site") & "?www.leisure-ideas.com"><font size='1' face='Verdana'>Visit Web Site</font></a>") You were trying to response write the WORD "FP_Field(fp_rs,"Web Site")" and not the DB VALUE.... Does that make sense?
< Message edited by rdouglass -- 12/5/2003 11:36:33 AM >
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: "if then" help - 12/5/2003 11:48:50
I'm not having a good day. Now I get a compilation error. This is what I'm using: <% if FP_FieldVal(fp_rs,"Web Site") = "" then response.write("<a href=" & FP_Field(fp_rs,"Web Site") & "?www.leisure-ideas.com"><font size='1' face='Verdana'>Visit Web Site</font></a>") else 'do something for NO end if %>
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: "if then" help - 12/5/2003 12:09:31
quote:
<% if FP_FieldVal(fp_rs,"Web Site") = "" then response.write("<a href=" & FP_Field(fp_rs,"Web Site") & "?www.leisure-ideas.com"><font size='1' face='Verdana'>Visit Web Site</font></a>") else 'do something for NO end if %> Delete the double quote behind www.leisure-ideas.com. Thanks rdouglas for jumping in.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
BeTheBall
Posts: 6362 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: "if then" help - 12/5/2003 13:14:35
quote:
Notice my single quotes? Try that one... I am not so sure on that one. I tested this (no single quotes) on my site and it worked like a charm: "<a href="&FP_Field(fp_rs,"Link")&"?www.msn.com>Click</a>"
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: "if then" help - 12/8/2003 13:17:19
This works great - kinda! while the link is now working perfectly the if part of the statement isn't This: <% if FP_FieldVal(fp_rs,"Web Site") = "" then response.write("<a href='" & FP_Field(fp_rs,"Web Site") & "?www.leisure-ideas.com'><font size='1' face='Verdana'>Visit Web Site</font></a>") else 'do something for NO end if %> doesn't return anything this: <% if FP_FieldVal(fp_rs,"Web Site") <> "" then response.write("<a href='" & FP_Field(fp_rs,"Web Site") & "?www.leisure-ideas.com'><font size='1' face='Verdana'>Visit Web Site</font></a>") else 'do something for NO end if %> returns everything. I'm trying to say "if this field contains anything then"
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
|
|
rdouglass
Posts: 9270 From: Biddeford, ME USA Status: offline
|
RE: "if then" help - 12/8/2003 13:25:13
quote:
if FP_FieldVal(fp_rs,"Web Site") = "" then try: if Trim(FP_FieldVal(fp_rs,"Web Site")) = "" then
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: "if then" help - 12/8/2003 14:45:12
i have: <% if Trim(FP_Field(fp_rs,"Web Site")) = "" then response.write("<a href='" & FP_Field(fp_rs,"Web Site") & "?www.leisure-ideas.com'><font size='1' face='Verdana'>Visit Web Site</font></a>") else 'do something for NO end if %> but still no joy :( could it be the db?
_____________________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|