By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,672 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

OnChange & Hidden form element

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

thnx,
Christoph
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Christoph wrote:
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.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #2

P: n/a
Christoph wrote:
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...

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.