fieldset height inside a <td>

N

Nate12o6

Hey guys, i am having trouble with getting the heights corrected on my
fieldset. Right now i have 2 table cells side by side. And inside of
each there is a field set. The fieldset to the right is longer then
the one to the left. So the one to the left centers itself virticaly
to the cell. Is there any way i can eather raise it all the way to
the top or make the height 100% of the cell? I have tried height=100%
and a few other things with no luck. Here is my code:


<table width="100%">
<tr>
<td width="25%" cellpadding="20">
<fieldset style="float:top;">
<legend>Clients</legend>
Customer john
</fieldset>
</td>
<td width="75%">
<form action="testPost.php" method="post">

<div id="clientInfo">
<fieldset>
<legend>Client order information</legend>
<table width=100% cellpadding="20">
<tr>
<td width="65%">
<label>Name</label><br/>
<input type="text" name="custName" size="36"><br/>
<label>Billing Address</label><br/>
<input type="text" name="billAddrLine1" size="36"><br/>
<input type="text" name="billAddrLine2" size="36"><br/>
<input type="text" name="billAddrLine3" size="36"><br/>
<label>Phone Number</label><br/>
<input type="text" name="custPhone" size="36"><br/>
<label>Email Address</label><br/>
<input type="text" name="custEmail" size="36"><br/>
<label>Order Terms</label><br/>
<input type="text" name="orderTerms" size="36"><br/>
<label>Order Date</label><br/>
<input type="text" name="orderDate" size="36"><br/>
<label>Order#</label><br/>
<input type="text" name="orderNo" size="36"><br/>
<label>Tax ID#</label><br/>
<input type="text" name="taxId" size="36"><br/>
<label>Purchase Order#</label><br/>
<input type="text" name="purchOrder" size="36"><br/>
</td>
<td align="left" width="35%">
<b style="font-size: 1.3em;">Additional Options</b><br/>
<fieldset style="padding: 0 0 0 0">
<legend>Select Ship To Address</legend>
<SELECT NAME="shipToAddr" SIZE=3 style="TEXT-
ALIGN:right;background: #fffbef;">
<OPTION VALUE=a>Address 1
<OPTION VALUE=b>Address 2
</SELECT>
</fieldset><br/>

<fieldset style="padding: 0 0 0 0">
<legend>Shipping Method</legend>
<SELECT NAME="shipMeth" SIZE=3 style="TEXT-
ALIGN:right;background: #fffbef;">
<OPTION VALUE=a> Best Way
<OPTION VALUE=b> Special
</SELECT>
</fieldset><br/>

<b style="font-size: 1.3em;">Payment Method</b><br/>
<input type="radio" name="payMeth" value="COD">COD<BR/>

<table align="right">
<tr><td align="right">
<INPUT TYPE="button" VALUE="Proceed >" style="font-weight:
bold; -moz-border-radius: 5%" onClick="hideItemEntry();"><BR/><BR/>
<INPUT TYPE="button" VALUE="Print Blank Form" style="height:
20px; width: 175px; text-align: left"><BR/><BR/>
<INPUT TYPE="button" VALUE="Print Completed Form"
style="height: 20px; width: 175px; text-align: left">
</td></tr>
</table>
</td>
</tr>
</table>
</fieldset>
</div>

<div id="PaymentInfo"></div>
<div id="itemEntrySection"></div>



</form>
</td>
</tr>
</table>




The fieldset that is to small is the client one. Thanks in advance.
 
A

Adrienne Boswell

Hey guys, i am having trouble with getting the heights corrected on my
fieldset. Right now i have 2 table cells side by side. And inside of
each there is a field set. The fieldset to the right is longer then
the one to the left. So the one to the left centers itself virticaly
to the cell. Is there any way i can eather raise it all the way to
the top or make the height 100% of the cell? I have tried height=100%
and a few other things with no luck. Here is my code:


<table width="100%">
<tr>
<td width="25%" cellpadding="20">
<fieldset style="float:top;">
<legend>Clients</legend>
Customer john
</fieldset>
</td>

First, it would be a lot better to provide a URL - easier for us to see
the actual markup than what you may have pasted incorrectly.

Second, you have some strange markup. Fieldset must be contained in a
form element - it cannot be by itself.

(Aside - I wish people would stop abusing tables -- it's sooo much
easier to use the right element(s) for the job.)
 
N

Nate12o6

Gazing into my crystal ball I observed "Nate12o6" <[email protected]>
writing in




First, it would be a lot better to provide a URL - easier for us to see
the actual markup than what you may have pasted incorrectly.

Second, you have some strange markup. Fieldset must be contained in a
form element - it cannot be by itself.

(Aside - I wish people would stop abusing tables -- it's sooo much
easier to use the right element(s) for the job.)


Well this is all inside a form and i would love to give you a url but
it is not publicly accesible at this time. What elements do you
sugest insted of tables? div and spans?
 
A

Adrienne Boswell

Well this is all inside a form and i would love to give you a url but
it is not publicly accesible at this time. What elements do you
sugest insted of tables? div and spans?

No, it is NOT inside a form. Do you see a form element there? I don't.
I see the form element farther down:
<td width="75%">
<form action="testPost.php" method="post">

<div id="clientInfo">
<fieldset>

For this to be correct, the form element must come first: eg:

<form>
<table>
<tr>
<td>
<fieldset><legend></legend>
</fieldset>
</td>
</tr>
</table>
</form>

I suggest you use the correct markup for the job. If you want to divide
the page up into areas, then, yes, use a div. If you want to use inline
style, use a span. If you want to make a form, make a form, and use
fieldset, label, input, select, and textarea as needed. If you want to
show tabular data, use a table.
 
S

Steven Saunderson

No, it is NOT inside a form. Do you see a form element there? I don't.

Does a fieldset have to be inside a form ? I gather it is intended to
be so but I couldn't find any spec saying it is only allowed in a form.
I have used it recently (e.g. http://stevensaunderson.com/pickup.htm)
and it seems to work fine and the W3C validator doesn't complain.
 
S

Steven Saunderson

http://www.w3.org/TR/html401/interact/forms.html#edef-FIELDSET

"17.10 Adding structure to *forms*: the FIELDSET and LEGEND elements"

Yes, I read this and it and it implies fieldset is for forms. But

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

shows no such restriction.
Fieldset doesn't make a lot of sense outside of forms.

I saw a good use of fieldset in a cPanel web log report. It provides a
simple way to group requests for each host and include the IP address in
the top border. I decided to use fieldset for a change log but if it is
improper or immoral or something like that then I'd better fix my page.
 
J

Jukka K. Korpela

Scripsit Steven Saunderson:
I saw a good use of fieldset in a cPanel web log report. It provides
a simple way to group requests for each host and include the IP
address in the top border. I decided to use fieldset for a change
log but if it is improper or immoral or something like that then I'd
better fix my page.

The main problem with using a fieldset outside a form is that it may be
misleading. Since fieldsets normally appear in forms only, the user may
expect that there is a form involved.

The visual appearance of fieldset elements in browsers is varying, and many
authors think that it is so poor that they refrain from using fieldset
markup for constructs where it would be most logical. Thus, if you are using
the markup for its visual effects only, you should know that the effects and
their impact are different to different users - and might make some of them
think where the form fields are and what the form is for.
 
B

Bergamot

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

shows no such restriction.

The above only means that fieldset is a block element, which doesn't say
anything about its parent container. Note that fieldset can be within a
div or table, but there should still be a form ancestor somewhere in there.
 
S

Steven Saunderson

The above only means that fieldset is a block element, which doesn't say
anything about its parent container. Note that fieldset can be within a
div or table, but there should still be a form ancestor somewhere in there.

Thanks for your reply. Based on this, and Jukka's warnings about my
non-standard use of fieldset, I will fix my page. This is a pity
because it seems to work well but I now suspect that somewhere down the
road I will look back and realise how dumb it was.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top