OnChange & Hidden form element

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

    #1

    OnChange & Hidden form element

    Is there any way you can trigger a function when the
    value of a hidden form element is changed?

    thnx,
    Christoph


  • David Dorward

    #2
    Re: OnChange & Hidden form element

    Christoph wrote:
    [color=blue]
    > Is there any way you can trigger a function when the
    > value of a hidden form element is changed?[/color]

    Events are only triggered by users. There is no way for a user to change the
    content of a hidden field. Only a script can do this. Have that script fire
    off whatever other functions you want.

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • RobB

      #3
      Re: OnChange &amp; Hidden form element

      Christoph wrote:[color=blue]
      > Is there any way you can trigger a function when the
      > value of a hidden form element is changed?
      >
      > thnx,
      > Christoph[/color]

      The only way that seems to work is via the onpropertychang e event
      handler:

      <input type="hidden".. ...onpropertych ange="alert('ch anged')" />

      ....which is IE-only afaik. The entire concept of a 'change' event for a
      hidden field is a bit shaky, as a change equals a value change followed
      by a blur - and blur/focus for hidden fields is a seemingly invalid
      concept. Since you can only change hidden fields programmaticall y
      (script), presumably as the programmer you'd already know when you (as
      opposed to a user) had changed the value...

      Comment

      Working...