GET URLs and forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Henrik S. Hansen

    GET URLs and forms

    A simple question I could not find the answer to in the RFCs and elsewhere:

    Is sending empty elements in a URL OK?

    example: <URL>?foo=&

    It seems to me that it must be, since default values of text fields and
    other form elements will be empty, but just checking with the experts.

    Could someone point me to the exact place in an official document where
    this is covered?

  • Klaus Johannes Rusch

    #2
    Re: GET URLs and forms

    "Henrik S. Hansen" wrote:
    [color=blue]
    > A simple question I could not find the answer to in the RFCs and elsewhere:
    >
    > Is sending empty elements in a URL OK?
    >
    > example: <URL>?foo=&
    >
    > It seems to me that it must be, since default values of text fields and
    > other form elements will be empty, but just checking with the experts.
    >
    > Could someone point me to the exact place in an official document where
    > this is covered?[/color]

    This is perfectly valid, see
    http://www.w3.org/TR/html401/interac...html#h-17.13.2 for details on what
    gets submitted. Note however that the specification allows the suppression of
    undefined name/value pairs:

    "If a control doesn't have a current value when the form is submitted, user
    agents are not required to treat it as a successful control."

    All of this applies to the way the URL is constructed when submitting forms,
    there is nothing in the HTTP URL specification that would disallow something
    like



    either.

    --
    Klaus Johannes Rusch
    KlausRusch@atme dia.net



    Comment

    Working...