473,788 Members | 3,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

detecting values for object properties

Tom
I need a little validation script to test whether a certain value for a
property exists or not: specifically, whether the value "table-row" is
a legit value for the style.display property. I'm turning table rows
on and off, and CSS2 supported browsers can use "table-row" as a value
for style.display, but browsers that don't support CSS2 (like IE 6.0)
don't recognize the value "table-row" as being valid (it returns an
error). The alternative is to use "style.disp lay = 'block';", but
browsers that use CSS2 turn the <trinto a block element, and it loses
the properties of a true <trelement (i.e. colspan, rowspan become
meaningless). So I need a detection (or something better if this is
sloppy).

Here's what I've got:

<script language="javas cript" type="text/javascript">
<!--
function turnRowOff( id ) {
thisDiv = document.getEle mentById( id );
thisDiv.style.d isplay = "none";
}
function turnRowOn( id ) {
thisDiv = document.getEle mentById( id );
if ( ??? some code ??? ) {
thisDiv.style.d isplay = "table-row" ;
} else {
thisDiv.style.d isplay = "block" ;
}
}
// -->
</script>

<a href="javascrip t:turnRowOff('w hatever');">tur n row on</a>
<table><tr id="whatever" style="display: none;"><td>Now you see
me!</td></tr></table>

Any ideas?

Jan 16 '07 #1
1 1065
Tom
Well I solved my own problem:
thisDiv.style.d isplay = "";

I'm still curious if there's a way to detect valid property assignments
though :-)

Tom wrote:
I need a little validation script to test whether a certain value for a
property exists or not: specifically, whether the value "table-row" is
a legit value for the style.display property. I'm turning table rows
on and off, and CSS2 supported browsers can use "table-row" as a value
for style.display, but browsers that don't support CSS2 (like IE 6.0)
don't recognize the value "table-row" as being valid (it returns an
error). The alternative is to use "style.disp lay = 'block';", but
browsers that use CSS2 turn the <trinto a block element, and it loses
the properties of a true <trelement (i.e. colspan, rowspan become
meaningless). So I need a detection (or something better if this is
sloppy).

Here's what I've got:

<script language="javas cript" type="text/javascript">
<!--
function turnRowOff( id ) {
thisDiv = document.getEle mentById( id );
thisDiv.style.d isplay = "none";
}
function turnRowOn( id ) {
thisDiv = document.getEle mentById( id );
if ( ??? some code ??? ) {
thisDiv.style.d isplay = "table-row" ;
} else {
thisDiv.style.d isplay = "block" ;
}
}
// -->
</script>

<a href="javascrip t:turnRowOff('w hatever');">tur n row on</a>
<table><tr id="whatever" style="display: none;"><td>Now you see
me!</td></tr></table>

Any ideas?
Jan 16 '07 #2

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

Similar topics

3
14952
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
1
18362
by: Daniel Diehl | last post by:
Hi, I'm looking for a solution to detect if a USB Sticker (USB Drive) ist plugged in or plugged out. Currently Im able to detect Hardware Plugin and Plugout but don't get any information what type of device it is. Is there a way to get this information ? Currenty my solution work in that way (Also from this group): protected override void WndProc(ref Message m) { switch(m.Msg)
1
1576
by: Mark Rae | last post by:
Hi, I'm looking for a reliable way of detecting the version of Windows that the ..NET framework is installed on, specifically the service pack. Currently, I'm using System.Environment.OSVersion and pulling the Major, Minor, Build and Revision properties out of that. However, e.g. Windows XP returns exactly the same values for no initial build, SP1 or SP2.
2
1406
by: Simon Harvey | last post by:
Hi all, Is there any easy way to check a field for calues that have changed on a post back. So the page is sent to the user, the user changes some values and I need to know which ones changed. Is the only way to do this to go through all the fields and check them against their old values. In which case, would I need to store the values in
27
2003
by: Deek | last post by:
I have a target(graphic) that moves via, i am trying to detect a hit of the target with and essay(copied below) my prof gave us, but I am not sure what to do, if you could get me going in the right direction i would appreaciate it: Private Sub tmrTarget_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrTarget.Tick 'Move the graphic(target) across the form Static intX As Integer = picTarget.Left
2
9350
by: Prabhudhas Peter | last post by:
Hello, Need an easy way to Display the property values of an object (dynamically) ie I need to show the values of an Object in a rich text box. Background : We have a form, with a rich text box, where we want to display the values of any given object (say customer, order etc). We declared (Dim Obj as New Object) and assigned our application object. Now we want to print
1
1565
by: Prabhudhas Peter | last post by:
Hello, Need an easy way to Display the property values of an object (dynamically) ie I need to show the values of an Object in a rich text box. Background : We have a form, with a rich text box, where we want to display the values of any given object (say customer, order etc). We declared (Dim Obj as New Object) and assigned our application object. Now we want to print
79
3797
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially appeared because NCSA stopped them from using "Mosaic" in the UA string. Is it some different...
10
1413
by: Nathan Sokalski | last post by:
I want to make sure I am doing a browser detection that will work once IE7 is released. My current detection statement (written using VB.NET) is: If Me.Request.Browser.Browser.ToUpper() = "IE" Then 'Code to use for Internet Explorer browsers Else 'Code to use for browsers other than Internet Explorer End If
0
9655
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.