473,804 Members | 3,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Correct Way to Reference Children of a DIV?

What is the correct way to find all the form elements in a particular
div? I'd like to be able to loop through them and disable them. For
example:

<form>
<div id="div1">
<input type=text name="a">
<input type=text name="b">
</div>

<div id="div2">
<input type=text name="c">
<input type=text name="d">
</div>

</form>

I'd like to be able to pass "div1" to a function and have it disable
text boxes a and b.

Thanks in advance for any help or ideas.

Nov 3 '05
17 2419
VK wrote:
CSS is not suitable for scaleable layout, [...]
Rubbish. Utter nonsense. As usual from you.
When did you last time visited the Web?


When did you? 5 or more years ago? Go away.
PointedEars
Nov 3 '05 #11
"VK" <sc**********@y ahoo.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
"VK" <sc**********@y ahoo.com> wrote in message
Naturally in design one *has* to use tables for nearly any form for
> nice looking scalable layout. I'm personally using it since 1997and
> over the passed years I had to place form elements to the most
> fantastic places - not only tables. :-)


Dag Sunde wrote:
Naturally, you meant to say:
"...in design one *has* to use divs/spans for nearly any form
for nice looking scaleable layout..."?

Tables are in a semantic document for presenting tabular data,
not for positioning elements.

For that, we have css.


CSS is not suitable for scaleable layout, this path has been explored
throughout during 4th versions on positioned elements and on the Java
1.x GridBagLayout
It failed to work and abandonned now in favor of the original
"invisible table" technique.
When did you last time visited the Web?
But it doesn't mean that we need to use table *every single time* some
positionning is needed.


Ehh...

I am very suprised to hear that!

My work consists mainly of design and development, with a lot of weight
on the design part. The target is usually the web (but not neccessarily).

3-4 years ago I stopped completely to use tables for page-layout,
and started using CSS instead. I have no problems whatsoever in
implementing any design whith CSS instead of tables.

In addtion, maintenance and extension have become downright pleasant
now that there is no "garbage" concerning Layout (or "looks") in the
pages themselves.

I think you are very alone in having "abandoned" CSS where most other
are just coming up to speed using it.

And the comment: "When did you last time visited the Web?" just
collapses in my opinion (as a professional designer and programmer).

--
Dag.

Nov 3 '05 #12
VK

Dag Sunde wrote:
I am very suprised to hear that!

My work consists mainly of design and development, with a lot of weight
on the design part. The target is usually the web (but not neccessarily).

3-4 years ago I stopped completely to use tables for page-layout,
and started using CSS instead. I have no problems whatsoever in
implementing any design whith CSS instead of tables.

In addtion, maintenance and extension have become downright pleasant
now that there is no "garbage" concerning Layout (or "looks") in the
pages themselves.

I think you are very alone in having "abandoned" CSS where most other
are just coming up to speed using it.

And the comment: "When did you last time visited the Web?" just
collapses in my opinion (as a professional designer and programmer).


I guess it's going to be the question of preferences (until directly
prohibited by standards / not supported by browsers). You know mines -
I know yours. As the topic is not called "Correct way to build pages":
I'd like to apologize if my expressions were semi-provocative and close
this discussion within this thread. (?)

Nov 3 '05 #13
VK
> VK wrote:
CSS is not suitable for scaleable layout, [...]

Thomas 'PointedEars' Lahn wrote: Rubbish. Utter nonsense. As usual from you.


Hah, one of my hard case patients... Any *modern* links by occasion for
non-table based more-or-less known sites? ("mission statement" sites
like w3.org please out)

Nov 3 '05 #14
VK wrote:

Will you please learn how to quote in Usenet? <http://jibbering.com/faq/>

[Quotation corrected]
Thomas 'PointedEars' Lahn wrote:
VK wrote:
> CSS is not suitable for scaleable layout, [...]

Rubbish. Utter nonsense. As usual from you.


Hah, one of my hard case patients... Any *modern* links by occasion for
non-table based more-or-less known sites? ("mission statement" sites
like w3.org please out)


The question itself is biased, I will not answer it "as is". I do not have
to provide a site that does not qualify as "mission statement site" by your
humble standards.

a) You are the one with the thesis (that CSS is not suitable for scalable
layouts), you are to prove it. But then, shifting the burden of proof
is a logical fallacy I am not wondered of experiencing from you,
especially on this subject.

b) Since we are not talking about percents of usage of a technique (CSS)
but of applicability of a technique (CSS) to a problem (scalable layout),
I can show you *any* site that successfully uses CSS in order to prove
my point (even though I am not obliged to that in matters of conduct of
discussion).

Here you are:

<http://www.csszengarde n.com/>

You can use your favorite search robot to find more examples.
I will be not your assistant in turning the point in question around.
PointedEars
Nov 3 '05 #15
VK wrote:
er*******@gmail .com wrote:
Thanks to everyone who has helped me.
Here's something I don't understand:
VK wrote:
<snip> For the posted code table layout was not requested, so
internal subdivisions using <fieldset> were totally logical
*and* more correct then <div> because <fieldset> *is* direct
form's child and direct parent to its elements. Just check
and compare myDiv.form and
myFieldset.form property.

<snip>

The existence of the - form - property of the W3C HTML Level 1 DOM
specified - HTMLFieldSetEle ment - interface does not suggest that
FIELDSET elements should be children of FORM elements. Indeed as the
specification states that the - form - property "Returns null if this
control is not within the context of a form" the implication is that a
FIELDSET is not even expected in a FORM in all cases.

As to whether a FIELDSET element is a "more correct" child of a FORM
than a DIV, and the proposal that a FIELDSET "*is* direct form's child
and direct parent to its elements", The strict HTML DTD defines a form
as:-

<!ELEMENT FORM - - (%block;|SCRIPT )+ -(FORM) -- interactive form -->

- and the transitional DTD as:-

<!ELEMENT FORM - - (%flow;)* -(FORM) -- interactive form -->

So in the strict DTD the direct children of a FORM must be %block and/or
SCRIPT elements, excluding FORM elements. And in the transitional DTD
the direct children may be %flow elements, excluding FORM.

The Strict DTD defines %block as:-

<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">

- in which DIV and FIELDSET have equal significance.

While the transitional DTD defines %flow as:-

<!ENTITY % flow "%block; | %inline;">

- and %block as:-

<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
TABLE | FIELDSET | ADDRESS">

- where, again, DIV and FRAMESET have equal status.

The only distinction between the two are their respective semantic
meanings. The DIV element is a semantically neutral division (of
arbitrary page content). As to the meaning of FIELDSET, the text of the
HTML specification says:-

"The FIELDSET element allows authors to group thematically related
controls and labels. Grouping controls makes it easier for users to
understand their purpose while simultaneously facilitating tabbing
navigation for visual user agents and speech navigation for
speech-oriented user agents. The proper use of this element makes
documents more accessible."

The application of semantic mark-up involves the assignment of meaning
by its (human) author, and the observation that the controls within a
form are divided into two divisions is not enough to determine that the
division should mean that the controls are in two "thematic" groups.

So the test of correctness between DIV and FIELDSET hangs on the
author's perception of the contained form controls as "thematical ly
related" to each other while not "thematical ly related" to those in the
other division.

Turning to the FIELDSET element's DTD entry, both DTDs define FIELDSET
as:-

<!ELEMENT FIELDSET - - (#PCDATA,LEGEND ,(%flow;)*)
-- form control group -->

And so the permissible content for FIELDSET is #PCDATA and LEGEND and
%flow elements.

So a FIELDSET may be the direct child of a FORM, but it may also be a
descendant of a FORM and it may also appear in any other element that
allows %block content and outside of any FORM. And form controls may be
direct children of a FIELDSET, but they may also be descendants of a
FIELDSET and they may also appear in many contexts outside of a
FIELDSET.

If a FIELDSET "*is* direct form's child and direct parent to its
elements" it would be possible for the DTD to express that restriction
so the fact that neither of them does suggests that the assertion is
false, incomplete or misconceived.

Richard.
Nov 4 '05 #16
Richard Cornford wrote:
VK wrote:
er*******@gmail .com wrote:
Thanks to everyone who has helped me.
Here's something I don't understand:
VK wrote:

<snip>
For the posted code table layout was not requested, so
internal subdivisions using <fieldset> were totally logical
*and* more correct then <div> because <fieldset> *is* direct
form's child and direct parent to its elements. Just check
and compare myDiv.form and
myFieldset.form property.

<snip>

The existence of the - form - property of the W3C HTML Level 1 DOM
specified - HTMLFieldSetEle ment - interface does not suggest that
FIELDSET elements should be children of FORM elements.


W3C DOM Level 1 HTML (which is the correct [order of] term[s])
has been rendered obsolete by the W3C "Document Object Model (DOM)
Level 2 HTML Specification"[1], as I mentioned in my latest
contribution to the FAQ.

However, your statement also holds true for the latter.
PointedEars
___________
[1] <http://www.w3.org/TR/DOM-Level-2-HTML/>
Nov 4 '05 #17

Richard Cornford wrote:
I suspect that Julian Turner knows enough not to talk about what he doesn't know


As an amateur (a lawyer by day) I aim to achieve this as much as
possible, with the occasional opinion ventured when feeling foolhardy.

Julian

Nov 7 '05 #18

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

Similar topics

2
1605
by: Raghuraman | last post by:
Hi, I have some tables which have references between them. If i delete the reors in the child tables , since it references the column of the parent , i get error msg in my front end (quite natural). do u tell me how to delete the child table records with out affecting the relation ships or can recreate the relations with out affecting my data & structure and the constraints.
2
1589
by: Good Enchiladas | last post by:
While building on a class library for an object model, I get the above error message. The steps to recreate the problem are as follows: 1. Build a RootLevel.dll containing only this code: Public Class Root End Class
5
3000
by: JC | last post by:
hi all First of all, sorry for my (bad) english, I have a javascript: <script type="text/javascript"> <!-- function gointo(td,color){td.style.cursor='default';td.bgColor=color;} function gooutoff(td,color){td.style.cursor='default';td.bgColor=color;}
1
3433
by: Guogang | last post by:
Hi, I have a tree structure in C# with pointer to children and parent. This will form a circular reference. My question: will this kind of circular reference affect garbage collection (parent has references to children, and children have references to parent. such that none of them can be GC)? If yes, how can I avoid it? Thanks,
3
752
by: TN Bella | last post by:
I can't figure this out and I need some help...please! Object reference not set to an instance of an object. 'Insert data into the account table Sub doInsert2(Source as Object, E as EventArgs) Dim strConn as string = "server=abcdef;database=a_;trusted_connection=true" Dim Mysql1 as string Dim MyConn1 As New SqlConnection(strConn) MySql1 = "INSERT INTO
2
2678
by: Martin Ortiz | last post by:
Ugh.... All classes are copy by reference, even if you use "ByVal" and NOT "ByRef" it's still a copy by reference. Of course, as a consequence, if you change any values of the object you passed in, the original object is affected. I expect this with arrays, but not with single objects being passed "ByVal" to functions.... Is there a sane to get "ByVal" passing of parameters? (copying fields is not
2
1446
by: Al in Dallas | last post by:
I made the mistake of creating an instance of a widget and assigning it to a name I'd already used. Now, if I use root.children or root.slaves(), I can see the "lost" widget, but can I do anything else with the string of numbers that shows up when I use root.children? I'd like to destory the widget, for example. it would be even better if I could create a new name and have it reference the "lost" widget. Of course, I can just kill my...
5
5073
by: RioRanchoMan | last post by:
I have a forum table where the field Forum_ID of the first thread corresponds to itself in the field Forum_Ancestor, and 0 (zero) for the field Forum_Parent when it is the first topic in a thread: Example of first topic in thread values ============================================= Forum_ID=13 (topic) Forum_Parent=0 Forum_Ancestor=13
6
2650
by: stephen.cunliffe | last post by:
Hi, I'm looking for opinion/facts/arguments on the correct nesting of UL, OL, & LI elements. For example, this is what I want (unordered list): * Item 1 * Item 2 * Item 3
0
9704
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
9572
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10303
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
10070
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9132
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...
0
6845
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5508
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
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.