473,545 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Possible to tell when a hidden field's value changes

Hi,

Is there a way to trigger an event when the value of a hidden field
changes? At a certain point in time my hidden field is getting
changed to a value that I don't want but I can't find a place in the
code where this is happening by doing a search for its variable name.

Thanks, - Dave
Oct 22 '08 #1
5 4229
On Oct 22, 8:06*pm, laredotornado <laredotorn...@ zipmail.comwrot e:
Hi,

Is there a way to trigger an event when the value of a hidden field
changes? *At a certain point in time my hidden field is getting
changed to a value that I don't want but I can't find a place in the
code where this is happening by doing a search for its variable name.
AFAIK, no, you can't trigger an event. A better way of finding the
rogue piece of code is to use a good tool like Firebug which allows
you to debug your Javascript app.

HTH,
/sasuke

Oct 22 '08 #2
On Oct 22, 11:06*am, laredotornado <laredotorn...@ zipmail.comwrot e:
Hi,

Is there a way to trigger an event when the value of a hidden field
changes? *At a certain point in time my hidden field is getting
No.
changed to a value that I don't want but I can't find a place in the
code where this is happening by doing a search for its variable name.
Search for what variable name? Sounds like you need to get acquainted
with your code.

Oct 22 '08 #3
In comp.lang.javas cript message <2d0fc7a0-2427-46e5-a637-e0e3ae10cf0e@j2
2g2000hsf.googl egroups.com>, Wed, 22 Oct 2008 08:06:38, laredotornado
<la***********@ zipmail.compost ed:
>
Is there a way to trigger an event when the value of a hidden field
changes? At a certain point in time my hidden field is getting
changed to a value that I don't want but I can't find a place in the
code where this is happening by doing a search for its variable name.
You have tried in browsers other than IE? Error reporting is nicer in
Firefox. You have tried changing the name/ID of the hidden variable?
You have read the FAQ and asked yourself why you don't say what
browser(s) the problem occurs in?

You could edit your code for test so that the value of the hidden field,
before the unwanted change, its value is stored in a [global] variable.
Further edit to put, at the end of each existing code statement, pseudo-
code like
if hidden != saved than alert(<linenumb er>)
That should enable you to find where the change occurs, which is a step
towards finding why.

If the error only occurs somewhere in the middle of user actions, then
you could use setInterval to check very frequently whether a change had
occurred; that might help in associating it with some input action and
hence some part of the code.

Learning and using a good debugger is a good idea; but, for a one-off,
the above may be quicker, especially if you have a script-editor which
can auto-insert the test in suitable locations.

It's a good idea to read the newsgroup c.l.j and its FAQ. See below.

--
(c) John Stockton, nr London UK. ?@merlyn.demon. co.uk IE7 FF2 Op9 Sf3
news:comp.lang. javascript FAQ <URL:http://www.jibbering.c om/faq/index.html>.
<URL:http://www.merlyn.demo n.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Oct 22 '08 #4
laredotornado wrote:
Is there a way to trigger an event when the value of a hidden field
changes?
Yes.
At a certain point in time my hidden field is getting changed to a value
that I don't want but I can't find a place in the code where this is
happening by doing a search for its variable name.
A hidden field is no variable.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Oct 22 '08 #5
laredotornado wrote:
Hi,

Is there a way to trigger an event when the value of a hidden field
changes?
It would be useful to have a reliable way to subscribe to property
change events. It wouldn't seem to
be the best way to debug your issue, though.

Mutation events are fickle, but you could try it out. Try setting a
mutation event for DOMAttrModified[1]. Make a simple testcase for it.

myInp.addEventL istener("DOMAtt rModified", function(ev) {
console.log(ev) ;
}, true);
For IE, use the developer toolbar. Or, you can also try using an -
onpropertychang e - handler[2].

myInp.onpropert ychange = function() {
alert(this.valu e);
}
[1]
http://www.w3.org/TR/DOM-Level-2-Eve...mutationevents
[2] http://msdn.microsoft.com/en-us/libr...56(VS.85).aspx

At a certain point in time my hidden field is getting
changed to a value that I don't want but I can't find a place in the
code where this is happening by doing a search for its variable name.

Thanks, - Dave

--
comp.lang.javas cript FAQ <URL: http://jibbering.com/faq/ >
Oct 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2190
by: Roy Adams | last post by:
Hi I'm reposting this question because for some reason can't post follow up question to this thread. What I'm trying to do is put the value and text from a a select in to a text field and to a hidden field respectfully and the value from dynamically created hidden fiields in to a text fieldin to a text field all at the same time Here's...
8
4562
by: Fabri | last post by:
Is it possible, as IE does in Windows Update, to ask onbeforeunload if the user want really close window (or tab) clicking on close (X) of the window? This window isn't opened by window.open. I think something like this: <script type="text/javascript">
3
1887
by: Henke | last post by:
How can data be passed to the server when an event is fired in client-side jscript, ie on a drop event? I have tried using hidden fields and submitting the page, but for some reason I can't access a html hidden field that is set to run as server control. Please can someone point me in the right direction here? /Henke
2
4231
by: Rodusa | last post by:
I have a hidden field inside one datagrid which I can't get to make it keep its state after a postback event. Look field: <input type="hidden" id="TxtHiddenItem_id" name="TxtHiddenItem_id" runat="server" value='<%# DataBinder.Eval(Container, "DataItem.item_id").ToString() %>'> I can get around that using an asp.net textbox control, but...
7
4434
by: Andy | last post by:
Hi, I have a complicated question that I'm hoping someone can help me out with. I have a webpage that contains a plug-in. This plug-in can communicate/pass data with the webpage that contains it via javascript. What I need to be able to do is take that data passed via javascript and, using vb.net as the code behind language, send it to a...
5
2751
by: dvwool | last post by:
Hello, Another newbie here... I've been trying to make this work for days now and have finally decided to post as I can't seem to get it to work. Here's what I'm trying to do... I have a select box with three options and a separate hidden field. The value of a hidden field is dependent upon which of the three options is selected. For...
10
6711
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that contains only tables. I have linked the tables for the front end to the back end database. I am trying to set the recordsource of a form to a query...
4
1894
by: _Raven | last post by:
Okay, I am playing with submitting forms with Ajax. I am trying to adapt this script to my forms: http://www.captain.at/howto-ajax-form-post-get.php I have included my code at the bottom of this post. Basically, this will work correctly if I remove all non-form related tags from the form =eg span, div, but I want to format the form all...
1
2008
by: cerilocke | last post by:
I have a repeater in which I have a hidden field (input type = hidden), a textbox (asp:TextBox), a checkbox (input type = checkbox) and a label (asp:Label). I have bound all four items to the same bit field in a dataset, and when the items are first bound, all four are correctly databound. For example, if the stored procedure returns 1 for...
0
7499
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7689
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7943
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7456
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6022
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5359
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3490
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1919
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.