How to detect form element changed?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Colin McKinnon

    How to detect form element changed?

    Hi,

    I want to be able to detect if a form no longer contains it's initial values
    before it gets submitted (to put it another way, would its values be
    different if the form were reset). I could keep a hidden shadow of every
    element and compare them, or set a flag via every elements onchange method
    but both seem rather combersome.

    Is there a simpler way to do it?

    TIA,

    C.
  • Ivo

    #2
    Re: How to detect form element changed?

    "Colin McKinnon" wrote[color=blue]
    > I want to be able to detect if a form no longer contains it's initial[/color]
    values[color=blue]
    > before it gets submitted (to put it another way, would its values be
    > different if the form were reset). I could keep a hidden shadow of every
    > element and compare them, or set a flag via every elements onchange method
    > but both seem rather combersome.
    >
    > Is there a simpler way to do it?[/color]

    This shadow already exists in DOM1 supporting browsers. They call it the
    defaultValue property:
    <URL: http://www.w3.org/TR/1998/REC-DOM-Le...-one-html.html[color=blue]
    >[/color]
    <URL:
    Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

    value.asp >

    --Iv


    Comment

    • Michael Winter

      #3
      Re: How to detect form element changed?

      On Sun, 15 Aug 2004 01:45:54 +0200, Ivo <no@thank.you > wrote:

      [snip]
      [color=blue]
      > This shadow already exists in DOM1 supporting browsers. They callit the
      > defaultValue property:[/color]

      It's actually been supported since JavaScript v1.0, along with
      defaultChecked for checkboxes and radio buttons. The latest of that type,
      Option.defaultS elected, was added in v1.1.

      [snipped links]

      Mike

      --
      Michael Winter
      Replace ".invalid" with ".uk" to reply by e-mail

      Comment

      • Colin McKinnon

        #4
        Re: How to detect form element changed?

        Michael Winter spilled the following:
        [color=blue]
        > On Sun, 15 Aug 2004 01:45:54 +0200, Ivo <no@thank.you > wrote:
        >
        > [snip]
        >[color=green]
        >> This shadow already exists in DOM1 supporting browsers. They callit the
        >> defaultValue property:[/color]
        >
        > It's actually been supported since JavaScript v1.0, along with
        > defaultChecked for checkboxes and radio buttons. The latest of that type,
        > Option.defaultS elected, was added in v1.1.
        >
        > [snipped links]
        >
        > Mike
        >[/color]

        Thanks both - I'll go see what else I can break

        Colin

        Comment

        Working...