473,321 Members | 1,877 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,321 software developers and data experts.

"onchange" behaves differently on different browsers

When a text field is terminated by a "tab" or change of focus, the browsers behave the same (IE, FireFox, Safari, Netscape).

When the text field is terminated by a "return", then "onchange" is called but the procedure appears to be executing in different contexts. Safari and IE cause an bad result, whereas Netscape and FireFox do the right thing.

Any ideas?
Mar 7 '07 #1
6 2888
sumittyagi
202 Expert 100+
When a text field is terminated by a "tab" or change of focus, the browsers behave the same (IE, FireFox, Safari, Netscape).

When the text field is terminated by a "return", then "onchange" is called but the procedure appears to be executing in different contexts. Safari and IE cause an bad result, whereas Netscape and FireFox do the right thing.

Any ideas?
havn't seen anything like this yet. post any sample code which creates such problem.
Mar 8 '07 #2
The code is too long to post but let me describe the situation:
Index.html consists of 6 frames with Javascript code before the body. The frames have no source.
"onload" is set to call a function that will populate each of the frames.

In one of the frames a form is defined that has a text field, and "onchange" is defined to retrieve the value and call a procedure that reloads the frames.

In most browsers hitting "return" after changing the text field either does nothing or the right thing. Hitting "return" in IE causes real problems.

You can see the page with the problem at:
http://www.rarebookroom.org/Control/chkwks/index.html

If, in IE, you fill in the spread number and hit return - bad things happen.

If you hit tab or click out of the field the right thing happens.
Mar 8 '07 #3
pronerd
392 Expert 256MB
Well the event handler seems to be triggering correctly. What value is it returning? It maybe referencing from the wrong frame, and so when it tries to find the value to return it can not and just returns a null. Do the forms share the same ID in the different frames?
Mar 8 '07 #4
There is only one form in one frame. I will check out what it returns.

Thanks
Mar 8 '07 #5
I've tried returning both true and false and neither changes the behavior.
Mar 8 '07 #6
I found the problem: I failed to specify an action and method in the form definition (since I was not posting any result but just using them within JavaScript). None of the browsers complained and most worked with this omission.

By setting the action definition to be the same as onchange definition, and returning a "false", everything seems to be fixed.
Mar 9 '07 #7

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

Similar topics

2
by: Mark Durgee | last post by:
I have a "submit" button in a form that creates a record in my Filemaker database that works as it should. This is the HTML for it: <INPUT TYPE="SUBMIT" name="-New" VALUE="Add Record"> I...
3
by: Norm via DotNetMonster.com | last post by:
I have an onchange event which fires when the content of an HTML textbox changes. My problem is that when I try to compare the content of this textbox with another HTML textbox using an if...
1
by: Nathan Sokalski | last post by:
When testing a form of mine which uses RequiredFieldValidators that have the Display property set to "Dynamic" the ErrorMessage property is automatically removed when an entry is completely typed...
1
by: julian.tklim | last post by:
Hi, I've got an input box with popup calendar (date picker) all generated using javascipt. Once a date is selected from the datepicker window, the date value is populated back to the input...
7
by: Tim Slattery | last post by:
I'm trying to handle the onChange event in an <input type="file"> element. In IE, there's no problem: the event fires when a file in the "open" box is doubleclicked, or the "Open" button in the box...
4
by: mbiasetti | last post by:
Hello, quick question (hopefully): I have a script that manipulates two "Select" elements. My onload calls a function that sets onchange for each "Select": ...
7
by: TriAdmin | last post by:
I am working with a system that allow me to add custom fields but I can not add OnChange() language to the custom fields. So I want to have a function in the header that recognizes when fieldx is...
19
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? ...
0
by: Akpo | last post by:
Hi all, i am writing an ajax and php application for a sec ondary school, and i want the contents of one select list to be based on the values of the select list that appears before it. The issue is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.