Web Wiz - Green Windows Web Hosting

  FAQ FAQ  Forum Search   Events   Register Register  Login Login

if "yes" then bgcolor=

 Post Reply Post Reply
Author
288enzo View Drop Down
Groupie
Groupie
Avatar

Joined: 28 April 2003
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote 288enzo Quote  Post ReplyReply Direct Link To This Post Topic: if "yes" then bgcolor=
    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.
Back to Top
ultramods View Drop Down
Groupie
Groupie
Avatar

Joined: 08 January 2003
Location: Scotland
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote ultramods Quote  Post ReplyReply Direct Link To This Post 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>

Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post 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")

Back to Top
288enzo View Drop Down
Groupie
Groupie
Avatar

Joined: 28 April 2003
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote 288enzo Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2003 at 3:35am

Dim cellColour, confirm

confirm=request.form("satellite")

New line

Back to Top
288enzo View Drop Down
Groupie
Groupie
Avatar

Joined: 28 April 2003
Location: United States
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote 288enzo Quote  Post ReplyReply Direct Link To This Post Posted: 10 May 2003 at 9:05am
Thanks but again, that worked like a charm.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.