OnChange & Hidden form element

C

Christoph

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

thnx,
Christoph
 
D

David Dorward

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

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.
 
R

RobB

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

thnx,
Christoph

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

<input type="hidden".....onpropertychange="alert('changed')" />

....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 programmatically
(script), presumably as the programmer you'd already know when you (as
opposed to a user) had changed the value...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top