IE input event OnChange?
Moderator: General Moderators
IE input event OnChange?
Does IE support <input.....onChange=...>?
How about firefox?
How about firefox?
Re: IE input event OnChange?
requinix wrote:Good question.
I indeed check those before I asked.
There is no explicit answer. You can try.
I am concerning about onchange and in input and for IE, particularly.
The answer I found are all very vague, and one of the problem I asked without answer so far seems to related to this
point.
Re: IE input event OnChange?
Quite suitable considering how vague your question is.wvoyance wrote:The answer I found are all very vague
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: IE input event OnChange?
You could create some code to test this; the results should satisfy your curiositywvoyance wrote:Does IE support <input.....onChange=...>?
How about firefox?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: IE input event OnChange?
I indeed created and tested, therefore I came here to ask whether have others had such experience.social_experiment wrote:You could create some code to test this; the results should satisfy your curiositywvoyance wrote:Does IE support <input.....onChange=...>?
How about firefox?
The code I created, tested, and discussed is viewtopic.php?f=68&t=135952
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: IE input event OnChange?
http://reference.sitepoint.com/html/eve ... s/onchange
According to this url IE does support the event
According to this url IE does support the event
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: IE input event OnChange?
Yes, that page seems to be pretty clear. But at the later part it said "inline statement" should be avoided.social_experiment wrote:http://reference.sitepoint.com/html/eve ... s/onchange
According to this url IE does support the event
I do not know what other "more explicit" form should I write for such event?
Furthermore, as I tested, the event did not triggered as in FireFox do.
What follows is my program up-to-date:
======================================
<html>
<head>
<script src="../js/jquery.js" type="text/javascript"></script>
<title>insert many</title>
</head>
<body>
// javascript in the head cannot access object in the body
<script type="text/javascript"><!--
..... some code omitted here....
function start(str){
isb = parseInt(str.substr(0,12));
limit = isb+10;
for (isb; isb < limit; isb++){
isbn=fix_CheckSum(isb+'');
var surl="insert_one_book.php";
var pars="isbn="+isbn;
$.ajax({
url: surl,
dataType: 'json',
data: pars,
async: false,
success: function(textDoc){}});
};
}
//--></script>
<form method="get">
enter one ISBN: <input type="text" name="isbn" onChange="start(this.value)">
<button type="submit">Submit</button>
</form>
</body>
</html>
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: IE input event OnChange?
Can you paste the code on insert_one_book.php
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: IE input event OnChange?
Let me make a simple version:
<html>
<head>
<title>insert many books</title>
</head>
<body>
<script type="text/javascript"><!--
function start(str){
alert ("in loop ");
}
//--></script>
<form method="get">
enter one ISBN:
<input type="text" name="isbn"
onChange="start(this.value)">
<button type="submit">Submit</button>
</form>
</body>
</html>
<html>
<head>
<title>insert many books</title>
</head>
<body>
<script type="text/javascript"><!--
function start(str){
alert ("in loop ");
}
//--></script>
<form method="get">
enter one ISBN:
<input type="text" name="isbn"
onChange="start(this.value)">
<button type="submit">Submit</button>
</form>
</body>
</html>
Last edited by wvoyance on Wed Jun 27, 2012 8:19 pm, edited 2 times in total.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: IE input event OnChange?
I probably should have asked for this from the start: do you have a url to the script instead
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: IE input event OnChange?
Let me made it simple. The present program only contains an event, if trigered it will pop up a window.social_experiment wrote:I probably should have asked for this from the start: do you have a url to the script instead
But it does not triger in IE. The error message is also clear saying object do not support such event.
===================================================
<html>
<head>
<title>insert many books</title>
</head>
<body>
<script type="text/javascript"><!--
function start(str){
alert ("in loop ");
}
//--></script>
<form method="get">
enter one ISBN:
<input type="text" name="isbn"
onChange="start(this.value)">
<button type="submit">Submit</button>
</form>
</body>
</html>
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: IE input event OnChange?
I retyped the script on a new page in my editor and it worked in IE9. This might seem simplistic but try recreating the script (the form giving the issue) and see what happens
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Re: IE input event OnChange?
social_experiment wrote:I retyped the script on a new page in my editor and it worked in IE9. This might seem simplistic but try recreating the script (the form giving the issue) and see what happens
retype? You simply need to copy and paste. I don't believe it will wok.
I have tried on many machines. I am IE9.0.8112.16421
rev. 9.0.7
Attached is my screen. There is not only no response, but has error message explicitly, although it is in Chinese.
- social_experiment
- DevNet Master
- Posts: 2793
- Joined: Sun Feb 15, 2009 11:08 am
- Location: .za
Re: IE input event OnChange?
I did copy and paste it. Then i retyped it and it worked; 9.0.8112.16421 is the same version is use.wvoyance wrote:retype? You simply need to copy and paste. I don't believe it will wok.
Code: Select all
<html>
<head>
<title>Testing onChange again</title>
</head>
<body>
<script type="text/javascript" ><!--
function foo(str)
{
alert(str);
}
//--></script>
<form method="get" >
enter one ISBN:
<input type="text" name="field1" onchange="foo(this.value);" />
<button type="submit">Submit</button>
</form>
</body>
</html>
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering