Form won't validate without action/method?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Winter

    #16
    Re: Form won't validate without action/method?

    On Thu, 12 Feb 2004 15:13:41 -0000, Richard Cornford
    <Richard@litote s.demon.co.uk> wrote:

    [snip]
    [color=blue]
    > Designing to take advantage of server-side fall-back is usually a good
    > idea so even a form that represented a control panel for something that
    > could operate entirely client-side on an appropriately supportive
    > browser would be sensible. But that is taking advantage of the
    > submittability of forms to achieve reliability. But if the client-side
    > code has no intention of ever letting the form be submitted if it is
    > capable of executing I don't see that as indicating that a form should
    > not be present in the HTML.[/color]

    I had considered that example, but I would still class that as a
    submittable form. Though you might avoid submitting it if at all possible,
    the option, for reliability's sake, is still there. This might be avoided
    if there are two separate pages - one for server-side, one for client-side
    - but surely a hybrid would be more likely (it's simpler).

    [snip]
    [color=blue]
    > I am not convinced that the HTML specs are going to help much here. They
    > do describe and specify how a form and its controls are expected to be
    > handled by a UA in the context of being submitted, they couldn't do
    > otherwise the specification must specify whatever needs to be
    > standardised.
    >
    > The specification also describes the handling of the form controls when
    > a form is submitted and only leaves two control types (<input
    > type="button"> and <button type="button">) exclusively for client-side
    > interaction. So to the extent that it can be argued that FORM is
    > intended to be submitted and so should not used in contexts where it
    > will not be submitted, it might also be argued that, for example, SELECT
    > is also intended to be submitted and should not be used in contexts
    > where it cannot be.
    >
    > But while the specification describes how a FORM will be handled when it
    > is submitted, and requires an action attribute so the UA will know where
    > to make the request, it does _not_ require that a FORM actually be
    > submittable. That is, it does not impose a default mechanism for
    > submission if the form does not contain a control (such as a submit
    > button, but including others) that can trigger the submission, and it
    > does not require that such a control be included within the form.
    >
    > The HTML 4 specification does not impose submittability upon FORM
    > elements. If it did it probably could be used to override a semantic
    > interpretation of FORM based on the meaning (dictionary definition) of
    > the word. As it doesn't I still don't see any reason for considering a
    > FORM as necessarily other than a container for (multiple, related)
    > "spaces in which to insert facts or answers".[/color]

    I can appreciate that in a modern context, form elements could be used
    purely as containers, but most of the time, it is unnecessary. If there
    were a significant number of controls that needed to be accessed, I would
    concede to using a container to make referencing them simpler, and it
    would be illogical for me to reject the idea of containing related
    controls in form just because it wasn't submitted.

    Still, you probably won't see me using a form in solutions to this group
    unless the OP used one (this case is an exception as the element wasn't
    required at all), or it is obvious that one should be used due to the
    close relationship of the controls. Rest assured I won't advise against
    them, unless there is some overriding reason to do so (again, this thread
    is an example).

    Once again, I fall to someone else's opinions, but I do enjoy these little
    chats. :)

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    • Richard Cornford

      #17
      Re: Form won't validate without action/method?

      "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
      news:opr296maj9 5vklcq@news-text.blueyonder .co.uk...
      <snip>[color=blue]
      >Once again, I fall to someone else's opinions, but I do
      >enjoy these little chats. :)[/color]

      Don't give up yet, I am not totally convinced that I am right. I thought
      I would get an expert opinion on the semantic aspect of the question so
      I posted a question to comp.infosystem s.www.authoring.html to see if
      they had any consensus of opinion on the subject. (and I suspect that
      they will favour submittability, but not necessarily for any good
      reason).

      Richard.


      Comment

      • Richard Cornford

        #18
        Re: Form won't validate without action/method?

        "Dr John Stockton" <spam@merlyn.de mon.co.uk> wrote in message
        news:ixpkAIAnQ4 KAFwsg@merlyn.d emon.co.uk...
        <snip>[color=blue]
        >Is there some element that can be used instead of <FORM name=XX>
        > ... </form> to give a similar naming structure?[/color]

        Not with the same built in form/control referencing mechanism. On W3C
        DOM browsers, and with a quite a bit more code, any arbitrary (so
        probably DIV) container (with an ID attribute) could be used to isolate
        a branch in the DOM tree under which all of the controls occurred, using
        method such as - getElementsByTa gName - and possibly -
        getElementsByNa me - to look up specific descendants and assemble
        structures that could be referenced with similar convenience as the
        normal form properties.
        [color=blue]
        >DIV or SPAN maybe?
        >I want to be able to use document.Frm1.Z Z & document.Frm2.Z Z, and
        >F = document.Frm1 ; ...; F.ZZ & F = document.Frm2 ; ... ; F.ZZ, to
        >refer to two different-but-similar ZZ.[/color]
        [color=blue]
        >I could test, but only in my own browser, whereas I want something
        >that is known to be at least as good as FORM in all reasonable
        >browsers (include MSIE 4).[/color]

        You will not find anything as cross-browser as forms, scripted correctly
        they are about as good as it gets. At present, if javascript executes
        and the page is HTML then forms are pretty much consistent in all
        browsers. Given 3 or 4 years for the dinosaurs to finally die off, the
        W3C DOM (most if it at least) will probably achieve the same
        reliability.
        [color=blue]
        >Pages such as <URL:http://www.merlyn.demo n.co.uk/holidays.htm>
        >are rather reliant on this capability; and it is always good to
        >minimise global identifiers.[/color]

        Given the nature of your pages, especially the fact that pages that talk
        about javascript while demonstrating it in the viewers browser probably
        aren't worth visiting without a javascript capable and enabled browsers,
        I don't see that you have any reason to change your existing use of
        forms (apart form the point I made in my last personal email to you).

        Richard.



        Comment

        • Michael Winter

          #19
          Re: Form won't validate without action/method?

          On Fri, 13 Feb 2004 07:44:30 -0000, Richard Cornford
          <Richard@litote s.demon.co.uk> wrote:
          [color=blue]
          > "Dr John Stockton" <spam@merlyn.de mon.co.uk> wrote in message
          > news:ixpkAIAnQ4 KAFwsg@merlyn.d emon.co.uk...
          > <snip>[color=green]
          >> Is there some element that can be used instead of <FORM name=XX>
          >> ... </form> to give a similar naming structure?[/color]
          >
          > Not with the same built in form/control referencing mechanism. On W3C
          > DOM browsers, and with a quite a bit more code, any arbitrary (so
          > probably DIV) container (with an ID attribute) could be used to isolate
          > a branch in the DOM tree under which all of the controls occurred, using
          > method such as - getElementsByTa gName - and possibly -
          > getElementsByNa me - to look up specific descendants and assemble
          > structures that could be referenced with similar convenience as the
          > normal form properties.[/color]

          getElementsByNa me() is a method of the HTMLDocument interface only.
          getElementsByTa gName() is a possibility as it is a method of the Element
          interface.

          Mike

          --
          Michael Winter
          M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

          Comment

          • Richard Cornford

            #20
            Re: Form won't validate without action/method?

            "Michael Winter" <M.Winter@bluey onder.co.invali d> wrote in message
            news:opr3azsdxp 5vklcq@news-text.blueyonder .co.uk...
            <snip>[color=blue]
            >getElementsByN ame() is a method of the HTMLDocument interface only.
            >getElementsByT agName() is a possibility as it is a method of the
            >Element interface.[/color]

            Yes, you are right. I can't have been thinking very clearly when I wrote
            that. (I was doubtful it would have been much use even if it was
            implemented at that point).

            Richard.


            Comment

            Working...