Onchange和Firefox ...... [英] Onchange et Firefox...

查看:69
本文介绍了Onchange和Firefox ......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我对一个简单的事件有一个大问题:onchange !!!

如果我写这个页面:

< html>

< body>

< form id =" vu">

< input id = QUOT; var01"名称= QUOT; var01"大小= QUOT; 5英寸onchange =" return false;" />

< / form>

< / body>

< / html> ;

IE中一切正常(我不能离开输入区!)但没有什么

在Firefox中发生!!!

看起来事件没有被解雇或......


你有什么线索吗?


非常感谢你。


大卫。

Hi,

I have a big problem with a simple event : onchange !!!
If I write this page :
<html>
<body>
<form id="vu">
<input id="var01" name="var01" size="5" onchange="return false;"/>
</form>
</body>
</html>
everything is ok in IE (I can''t leave the input zone !) but nothing
happens in Firefox !!!
It looks like the event is not fired or...

Do you have any clue ?

Thank you very much.

David.

推荐答案

da ********** @ wanadoo.fr 在7/11/2006 4:01 AM说了以下内容:
da**********@wanadoo.fr said the following on 7/11/2006 4:01 AM:




我对一个简单的事件有一个大问题:onchange !!!
Hi,

I have a big problem with a simple event : onchange !!!



与您的主题行相反,IE似乎是错误的。

Contrary to your Subject line, it seems IE is the one that is wrong.


如果我写这个页面:

< html>

< body>

< form id =" vu">

< input id =" var01"名称= QUOT; var01"大小= QUOT; 5英寸onchange =" return false;" />

< / form>

< / body>

< / html> ;
If I write this page :
<html>
<body>
<form id="vu">
<input id="var01" name="var01" size="5" onchange="return false;"/>
</form>
</body>
</html>



您认为该代码应该怎么做?你告诉它当

这个改变了,什么都不做。嗯,这就是Firefox所做的 - 没有。

What do you think that code is supposed to do? You are telling it "When
this gets changed, do nothing". Well, that is what Firefox does - nothing.


IE中的一切正常(我不能离开输入区!)但没有什么

发生在Firefox !!!
everything is ok in IE (I can''t leave the input zone !) but nothing
happens in Firefox !!!



那时你的方式是错误的。 onchange =" this.focus()"

You are going about it the wrong way then. onchange="this.focus()"


看起来事件未被触发或...
It looks like the event is not fired or...



或者你试图以错误的方式解决错误的问题。

Or you are trying to solve the wrong problem the wrong way.


你有什么线索吗?
Do you have any clue ?



我有很多线索,你想要多少?


答案是免费的,线索是100美元每个。

-

兰迪

comp.lang.javascript常见问题 - http://jibbering.com/faq &新闻组每周

暂时在: http:// members.aol.com/_ht_a/hikksnotathome/cljfaq/

Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices/

I have lots of clues, how many do you want?

Answers are free, clues are 100 Dollars US each.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


Randy Webb写道:
Randy Webb wrote:
da**********@wanadoo.fr 表示如下on on 11/11/2006 4:01 AM:
da**********@wanadoo.fr said the following on 7/11/2006 4:01 AM:




我对一个简单的事件有一个大问题:onchange !!!
Hi,

I have a big problem with a simple event : onchange !!!



与您的主题行相反,似乎IE是错误的。


Contrary to your Subject line, it seems IE is the one that is wrong.



好​​的。可能是我的解释错了;-)

OK. May be my explanation was wrong ;-)


如果我写这个页面:

< html> ;

< body>

< form id =" vu">

< input id =" var01"名称= QUOT; var01"大小= QUOT; 5英寸onchange =" return false;" />

< / form>

< / body>

< / html> ;
If I write this page :
<html>
<body>
<form id="vu">
<input id="var01" name="var01" size="5" onchange="return false;"/>
</form>
</body>
</html>



您认为代码应该怎么做?你告诉它当

这个改变了,什么都不做。好吧,这就是Firefox所做的 - 没有。


What do you think that code is supposed to do? You are telling it "When
this gets changed, do nothing". Well, that is what Firefox does - nothing.



我希望用户留在输入区。

I''d like the user to stay in the input zone.


IE中一切正常(我不能离开输入区!)但没有什么

在Firefox中发生!
everything is ok in IE (I can''t leave the input zone !) but nothing
happens in Firefox !!!



那时你的方式错了。平变化= QUOT; this.focus()"


You are going about it the wrong way then. onchange="this.focus()"



它什么都不改!!!

< html>

< body>

< form id =" vu">

< input id =" var01"名称= QUOT; var01"大小= QUOT; 5英寸onchange =" this.focus()" />

< input id =" var02"名称= QUOT; VAR02"大小= QUOT; 5英寸onchange =" this.focus()" />

< / form>

< / body>

< / html>

如果我在var01区域,我更改了值然后tab,我转到

var02区域!!!

它在IE中也不起作用......

It changes nothing !!!
<html>
<body>
<form id="vu">
<input id="var01" name="var01" size="5" onchange="this.focus()"/>
<input id="var02" name="var02" size="5" onchange="this.focus()"/>
</form>
</body>
</html>
If I am in the var01 zone, I change the value and then "tab", I go to
the var02 zone !!!
It doesn''t work in IE too...


看起来事件未被触发或...
It looks like the event is not fired or...



或者你试图以错误的方式解决错误的问题。


Or you are trying to solve the wrong problem the wrong way.



也许......

在IE中,它似乎很简单。我在一个区域,我验证了价值。如果它是

ok,我什么也不做(因此,用户将进入下一个区域),如果

值错误,我说return false并且用户留在这个区域

!!!

如果你有其他解决方案,我很好;-)

Perhaps...
In IE, it seems simple. I am in a zone, I verify the value. If it is
ok, I do nothing (so, the user will go in the next zone) and if the
value is wrong, I say "return false" and the user stays in this zone
!!!
If you have other solution, I''m ok ;-)


你有什么线索吗?
Do you have any clue ?



我有很多线索,你想要多少?


I have lots of clues, how many do you want?



好​​问题;-)只有最好的一个;-)


David。

Good question ;-) Only the best one ;-)

David.


答案是免费的,线索是每个100美元。

-

兰迪

comp.lang。 javascript常见问题解答 - http://jibbering.com/faq &新闻组每周

暂时在: http:// members.aol.com/_ht_a/hikksnotathome/cljfaq/

Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices/
Answers are free, clues are 100 Dollars US each.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/


David BERCOT写道:
David BERCOT wrote:

我希望用户留在输入区。
I''d like the user to stay in the input zone.

>> IE中一切正常(我不能离开输入区!)但在Firefox中没有发生任何事情!
>>everything is ok in IE (I can''t leave the input zone !) but nothing
happens in Firefox !!!


然后你会以错误的方式去做。平变化= QUOT; this.focus()"


You are going about it the wrong way then. onchange="this.focus()"



它什么都不改!!!

< html>

< body>

< form id =" vu">

< input id =" var01"名称= QUOT; var01"大小= QUOT; 5英寸onchange =" this.focus()" />

< input id =" var02"名称= QUOT; VAR02"大小= QUOT; 5英寸onchange =" this.focus()" />

< / form>

< / body>

< / html>

如果我在var01区域,我更改了值然后tab,我转到

var02区域!!!

它在IE中也不起作用...


It changes nothing !!!
<html>
<body>
<form id="vu">
<input id="var01" name="var01" size="5" onchange="this.focus()"/>
<input id="var02" name="var02" size="5" onchange="this.focus()"/>
</form>
</body>
</html>
If I am in the var01 zone, I change the value and then "tab", I go to
the var02 zone !!!
It doesn''t work in IE too...



onblur =" this.focus()"

Grtz,

-

Rik Wasmus


onblur="this.focus()"
Grtz,
--
Rik Wasmus


这篇关于Onchange和Firefox ......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆