473,388 Members | 1,207 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

onpropertychange for firefox

Hello,

I have a piece of code written for IE that uses onpropertychange. I want to make the code work on Firefox also, but i couldnt find an equivalent event that fires when the value is changed in JS scripts and i need help.

My problem is this. I have 2 html elements: an input type hidden that keeps the value which will be posted and an UI value (type=text) that shows the value to the user. What I need to do is to syncronize the modifications for these two values: when the hidden element is changed, the UI value is changed and vice-versa.

My script for IE :

Expand|Select|Wrap|Line Numbers
  1. <public:attach event="onpropertychange" onevent="handlePropertyChange()"/>
  2. <script language="JScript">
  3. function handlePropertyChange() {
  4. if (event.propertyName == 'value') {
  5. syncronize hidden element with UI
  6. }
  7. }
  8. </script>

and something similar for the UI element. The above code fires when I do :

Expand|Select|Wrap|Line Numbers
  1. function someFunction(el) {
  2. el.value = 5;
  3. }
and makes the UI value also 5 (and vice-versa).



Really, my question is how can i know when the value of the hidden element was changed somewhere in some JS script (and works on FF also) ?

Thank you,
Bogdan
Sep 21 '07 #1
12 13206
drhowarddrfine
7,435 Expert 4TB
please note that there is no such thing as "JScript" in standard HTML. Change this to <script type="text/javascript">
Sep 23 '07 #2
acoder
16,027 Expert Mod 8TB
onpropertychange is IE-only. Use onchange instead. This may not do exactly the same thing though, so you'll have to accommodate that in your code.
Sep 23 '07 #3
onpropertychange is IE-only. Use onchange instead. This may not do exactly the same thing though, so you'll have to accommodate that in your code.
I know about onpropertychange being IE-only (I used behaviour handlers in IE .htc files). What I want to know is what event for mozilla must i register with my elements in order to execute my functions when the value of a property is changed from within a javascript function (for example I change the value of the hidden, the event gets fired and executes my syncronization functions). Onchange doesnt fire when i change the value of the hidden from a JS function.
Sep 24 '07 #4
gits
5,390 Expert Mod 4TB
hi ...

may be its:

Expand|Select|Wrap|Line Numbers
  1. onDOMAttrModified
  2.  
what you are after. have a look here at the w3c for mutation events.

kind regards
Sep 24 '07 #5
hi ...

may be its:

Expand|Select|Wrap|Line Numbers
  1. onDOMAttrModified
  2.  
what you are after. have a look here at the w3c for mutation events.

kind regards
Thank you, that seems to be the event I need. I doesnt work in IE though and I'll need to make cross-browser scripts.
Sep 24 '07 #6
gits
5,390 Expert Mod 4TB
hi ...

of course ... but now you have everything to do it or not?

kind regards
Sep 24 '07 #7
Yes, I have what I need now. Thank you.
Sep 24 '07 #8
gits
5,390 Expert Mod 4TB
:) ok ... post back to the forum anytime you have more questions ...

kind regards
Sep 24 '07 #9
Yes, I have what I need now. Thank you.
Hi, I have the same situation,
Could you tell me the solution pls.

Thanks in advance
Regards,
Sakthikumar
Jan 21 '08 #10
Hi, I have the same situation,
Could you tell me the solution pls.

Thanks in advance
Regards,
Sakthikumar
Read the entire thread. It's RIGHT THERE. And it's spelled "please".
Jan 22 '08 #11
Read the entire thread. It's RIGHT THERE. And it's spelled "please".
Yeah thanks that really helped me out but let's not be so pedantic, isn't it 'spelt' instead of 'spelled'?"
Sep 27 '08 #12
acoder
16,027 Expert Mod 8TB
No, both regular and irregular forms are used, though one more than others in places.

Anyway, back on topic, to make cross-browser scripts, try the standard mutation events first. If they're not supported, try using onpropertychange.
Sep 27 '08 #13

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

Similar topics

87
by: expertware | last post by:
Dear friends, My name is Pamela, I know little about CSS, but I would like to ask a question I have an image on a web page within a css layer: <DIV ID=MyLayer STYLE = "position:...
14
by: expertware | last post by:
Ok! to avoid confusion I will start a new argument. Thanks!! FIREFOX 1.0.7 AND IE6 viewed through DATATIME: a summary REPORT ===============================================================...
5
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>>...
12
by: amit | last post by:
Hello group, I'm kinda skeptical about a code is being used in my js program. All it does is checking what browser is being run and finds out if FLASH is installed or not. This code works...
6
by: scotty | last post by:
I have a script that loops through an existing table list and prepares each href element node to trigger a function when an image is clicked. The function that will be run passes a property value...
7
by: Carlos Mendonça | last post by:
Has anyone managed to get ClickOnce to work with Firefox? It seems to me that it still has the same issues VS 2K5 had. I appreciate any comments or tips.
2
by: praveen1983 | last post by:
what is the use of onpropertychange event in asp.net ? can u expl it with an explain
7
by: alhalayqa | last post by:
Hello , I have attached the onpropertychange event to my document as : // the handler function function propertychangeHandler(){
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...

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.