[HTML 4.01 T] Semantics of a non-form value field

Discussion in 'HTML & Website Design' started by Marfig, Feb 22, 2008.

  1. #1
    EDIT: I'm realizing now the title of this thread is no longer appropriate as I decided to change my question while typing it. A more appropriate title is "[HTML 4.01 T] Semantics for name/value pairs"

    Hello all,

    I would like to provide my code with correct (or near correct) semantics for the following example snippet:
    <p>Location: Madeira, Funchal</p>
    <p>Business: Sale</p>
    <p>Reference: VA32</p>
    <p>Price: &euro; 450,000.00</p>
    <p>Total area: 1,000 m<sup>2</sup></p>
    Code (markup):
    Its basically a non list of name/value pairs in which the values will later be supplied by a script. What would you suggest?

    As an extra question, would XHTML provide me with better semantics? I'm still wanting to study this specification, but can't at this point where it's more important I stick to what I'm more familiar with.
     
    Marfig, Feb 22, 2008 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You're going to want to use a definition list here. It looks like this:

    
    <dl>
    	<dt>Location:</dt>
    	<dd>Madeira, Funchal</dd>
    	<dt>Business:</dt>
    	<dd>Sale</dd>
    	<dt>Reference:</dt>
    	<dd>VA32</dd>
    	<dt>Price:</dt>
    	<dd>&euro; 450,000.00</dd>
    	<dt>Total area:</dt>
    	<dd>Total area: 1,000 m<sup>2</sup></dd>
    </dl>
    
    Code (markup):
     
    Dan Schulz, Feb 22, 2008 IP
  3. Marfig

    Marfig Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Dan,

    I was going for a <em> / <var> combination. DL/DT/DD did cross my mind at some time, but I couldn't quiet place it within the semantics of a value/pair combination until you suggested it and forced me back into the specification. What I found was that I missed this paragraph (emphasising is mine):
    Basically I was being too strict. It later proceeds to show an example where a DL is being used for dialog lines.

    Thank you for the reply.
     
    Marfig, Feb 23, 2008 IP
  4. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #4
    No problem. Structurally speaking, EM is used to give a selection of text "emphasis" while var is used to identify a variable from a computer program.

    For example...

    
    <p>
    	The variable <var>$name</var> stores the <em>name of the person</em> filling out the email contact form.
    </p>
    
    Code (markup):
     
    Dan Schulz, Feb 23, 2008 IP
  5. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #5
    We also chose definition lists to show output of a form. The dt's were taken from the labels of the forms, while the dd's were variables coming from the customer's input.

    <p>Location: Madeira, Funchal</p>

    Even if one side is emphasised and the other is a variable, is this still not a term (location) and a definition (here is name of the location)?
     
    Stomme poes, Feb 23, 2008 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Lists should never be used to contain form fields, since form fields are not content, they're containers.

    For more information, go to http://green-beast.com/blog/?p=259
     
    Dan Schulz, Feb 23, 2008 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Nay, it's a form OUTPUT. The form has been filled out, and submit was hit, and the information is presented back to the user so they can check that everything was filled in correctly.

    http://stommepoes.nl/Pizzaatje/invoeren2.html

    remove the "2" to see the form. This is what I mean.
     
    Stomme poes, Feb 23, 2008 IP
  8. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Ah, I see.
     
    Dan Schulz, Feb 23, 2008 IP