473,796 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting a change on a hidden field

Claus Mygind
571 Contributor
How do you get a trigger/event to fire on a hidden field. In this case I have a hidden field that is updated via a script. It seems when a field is updated in this manner none of the event triggers like "onChange" "onSelect" "onBlur" will fire.

Is there some script based way this can occur?

Currently I add code to every method I use to update a field from script. But I have a number on methods that does this, and I do not wish to go into each of them and add code that the field has been changed. I am looking for some way for the field to detect that something changed.
Mar 25 '08 #1
2 3428
hsriat
1,654 Recognized Expert Top Contributor
How do you get a trigger/event to fire on a hidden field. In this case I have a hidden field that is updated via a script. It seems when a field is updated in this manner none of the event triggers like "onChange" "onSelect" "onBlur" will fire.

Is there some script based way this can occur?

Currently I add code to every method I use to update a field from script. But I have a number on methods that does this, and I do not wish to go into each of them and add code that the field has been changed. I am looking for some way for the field to detect that something changed.
I think you might be changing the hidden input's value with JavaScript, as its not possible otherwise.

So just after you change the value of the field, in the next line, execute the code which you want to execute onchange.
Mar 25 '08 #2
Claus Mygind
571 Contributor
I think you might be changing the hidden input's value with JavaScript, as its not possible otherwise.

So just after you change the value of the field, in the next line, execute the code which you want to execute onchange.
You are correct. I am changing value via scripts (note plural). I did not want to have to change every script that updates the value of the field. I wanted the field to detect the change and fire the event, the same as if the user had made the change.

I have an add/edit/delete screen. On it I have several methods for the user to fill the form elements i.e. they can type in the field, they can use one of my search methods which open sub-windows for lookup purposes where they can select a record which is then backfilled on the calling screen via script. I am now adding ajax communication which goes out to look for the next 30 records which can be used by the user for browsing. So as you see there are a number of ways to fill the field. But only the user input (typing in the field) will trigger the onChange. And of course on my previous search methods I use script to mark the change. I was just hoping for a single point to capture any change that occurred regardless of the method of change.

Is that possible?
Mar 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

25
2922
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a script to invoke something on the server, and if it works, then it works. Is there a better way? I'm looking for the least intrusive way of doing it, from a web application point of view. i.e. I'd like to be able to drop this into an existing...
2
1406
by: Simon Harvey | last post by:
Hi all, Is there any easy way to check a field for calues that have changed on a post back. So the page is sent to the user, the user changes some values and I need to know which ones changed. Is the only way to do this to go through all the fields and check them against their old values. In which case, would I need to store the values in
7
1858
by: Simon Harvey | last post by:
Hi everyone, I'm having a frustrating problem and I don't know how to fix it without totally redoing a very complicated couple of pages on my site. I really hope some kind soul can help me :-) Its a very simple situation: I have 1 page that serves to create and update users and another page to add roles to the user.
6
6429
by: K Viltersten | last post by:
I have the following button: <asp:LinkButton id="Btn" runat="server" text="Click"> </asp:LinkButton> I have added an action listener in the javascript where I change the text on it: this.dom.textContent = "Clicked"; The change is effective but after the site has reloaded the text is back to "Click".
0
10449
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4114
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
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.