473,581 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Conditional Formatting

I'm trying to find out if it is possible to use javascript to make a
line of text appear on an HTML page, depending on database values. I
assume it is, but cannot get it to work. The database field is
capable of having one of 3 values, "R", "S", or "N". When the
database value is "R" or "S", I want the line of text to appear on the
page. If the database value is "N", I don't want any text to appear
(blank line is fine...).

I am using several webpages in conjunction with a common.js file and
use Dreamweaver for design.

Any help will be appreciated.

Thanks!
Jul 23 '05 #1
2 2012
T3letech wrote:
I'm trying to find out if it is possible to use javascript to make a
line of text appear on an HTML page, depending on database values. I
assume it is, but cannot get it to work. The database field is
capable of having one of 3 values, "R", "S", or "N". When the
database value is "R" or "S", I want the line of text to appear on the
page. If the database value is "N", I don't want any text to appear
(blank line is fine...).

<snip>

Using a JS to access a database, eh?

Use an if statement. If you're having difficulties, post some code
you're trying to use.

Stewart.
Jul 23 '05 #2
Thanks for the reply Stewart.
If you can't tell...I'm very new to JavaScript. I believe the code is
accessing the database. I am not sure though...

I should have posted my code originally.

Here is the code in my "common.js" file:

document.write( '<input name= IS_ATTR_CM_MINO R_LETTER_STATUS _CODE_1"
type="hidden">' );

(This fuction is not working...)
//New function for Minor Child rollout:
function MinorChild(sMin orChild) {
if (IS_ATTR_CM_MIN OR_LETTER_STATU S_CODE_1 == 'R' ||
IS_ATTR_CM_MINO R_LETTER_STATUS _CODE_1 == 'S'){
sMinorChild = 'Minor Child Letter Request'
//else
//sMinorChild = ''
}
}

Here is the code on my HTML page:

(in the <script> section)
MINOR_CHILD_DAT A.innerText = FormatStringDat a(sMinorChild.v alue, 0,
'N/A');

(in the body of the page)
<p><span name = "MINOR_CHILD_DA TA">Minor Child?</span></p>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5924
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be terminated by pressing ++ and then terminate the process. I searched the entire internet and found out that there could be two things wrong (both...
4
3129
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the background colour. In A2000 it works great, but in A2003 the background doesn't always change and when it does it only changes when the record looses...
8
12031
by: Dimitri Furman | last post by:
Given: Access 2002/2003 A subform in datasheet or continuous view, placed on a tab page (this last may or may not matter) Conditional formatting applied to some controls on the subform - format expressions are the same for all controls Under some undetermined circumstances, when such subform is displayed, the controls on the subform start...
2
2955
by: Von Bailey | last post by:
I have a form where the conditional formatting is set on some fields to bold if certain conditions are met. However, when the conditions are met some of the data that is to bold is either not showing or only part of the data in the field displays (i.e. it will display the last name but not the first name or it will display neither). When...
2
1190
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold when the date has passed. Background: I have 2 related fields that are only rarely active, so I manage them in the query for the subform:...
5
8951
by: Andrew Chanter | last post by:
Does anyone know a way you can use conditional formatting to create a banded style view as is commonly seen on the internet. (In othe words the first record appears on a gray background, the 2nd on white, the third on gray etc etc.) I could write an expression based on the odd/even status of the primary key but this wont work when sorting...
1
4979
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of "MyField1" is True. No problem, I just need to write "Expression is" and " = -1 "
8
8472
by: Typehigh | last post by:
I have many text fields with conditional formatting applied, specifically when the condition is "Field Has Focus". Without any events associated with the fields the conditional formatting works perfectly. However, I have code that runs under the ON CLICK event. The code changes the focus to other controls, which means the conditional...
4
13153
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays "No." The conditional formatting is set up to read the 'Yes' or 'No' value and color the text accordingly. I have an event in the subform that...
2
3108
by: Filips Benoit | last post by:
Dear All, Access 2003 adp on SQL_server 2005 A continious form showing 1 month based on table 'CALENDAR_MONTH_GRID' and fill with a SP. Fields: Companyname, Day1, day2, etc. The value in the day-fields is like WK (weekend), NH (National holiday), etc. Depending on the fieldvalue the field is colored using conditional
0
7868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8175
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5674
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5364
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3805
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3827
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.