Print Page | Close Window

if "yes" then bgcolor=

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2561
Printed Date: 29 March 2026 at 9:20am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: if "yes" then bgcolor=
Posted By: 288enzo
Subject: if "yes" then bgcolor=
Date Posted: 09 May 2003 at 1:58pm
I'm not really sure if this question relates ASP or Java, that's how unknowledable I am.

After a user enters information on my enterinfo.asp page they get directed to a preapproval page that shows what they entered in a nice new layout for their approval before it actually gets submitted to my database.

My question is:

How can I make it so that if a specific field is "Yes" then it will show a specific cell with a background color other than white.

I am sure it has something to do with and if then else statement, just not sure how to write it.

Please help.

PS this site has been wonderful. I will have to mention it someplace on my own when it is done.



Replies:
Posted By: ultramods
Date Posted: 09 May 2003 at 2:32pm

<%
Dim cellColour, confirm

'get confirm from where ever it comes from

IF confirm = "yes" THEN
 cellColour = "bgcolor='#0000CC'"
END IF
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="30%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td <% = cellColour %> >test</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>



Posted By: Gullanian
Date Posted: 09 May 2003 at 5:23pm

'get confirm from where ever it comes from

that would probably be something like:

confirm = Request.form("confirm")

or

confirm = Request.form("FIELD_NAME")



Posted By: 288enzo
Date Posted: 09 May 2003 at 10:43pm

Thanks to the both of you.  I think I am on the right track but came up with this error.

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/in_work/add_listings_to_database2.asp, line 59

Dim cellColor, confirm = Request.form("satellite")
-----------------------^
Any ideas?
 
Thanks.


Posted By: MorningZ
Date Posted: 09 May 2003 at 11:36pm
as the error says, it expected and end of statement.. the line you posted above is bad syntax

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: Mart
Date Posted: 10 May 2003 at 3:35am

Dim cellColour, confirm

confirm=request.form("satellite")

New line



Posted By: 288enzo
Date Posted: 10 May 2003 at 9:05am
Thanks but again, that worked like a charm.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net