waseem02 / jquery-asmselect

Automatically exported from code.google.com/p/jquery-asmselect
0 stars 0 forks source link

Radio button automatically changes in FF3 when refresh/reload #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. In the same page put radio buttons with the same name.
2. refresh (F5 or Ctrl+R) in FireFox 3.

What is the expected output? What do you see instead?

I'm expecting that radio buttons don't changes the selection. But reloading
the page, the selection changes!.
In Internet Explorer(6) and Opera (+9) is Ok.

What version of the product are you using? On what operating system?

I'm using the verion 1.0.2-beta. I tryed it on Linux and Window XP

Please provide any additional information below.

This only happen in FireFox.

Original issue reported on code.google.com by apanca...@gmail.com on 4 Sep 2008 at 11:47

GoogleCodeExporter commented 8 years ago
Is this issue specific to asmSelect? I'm not sure because you've mentioned radio
buttons, which is not something that asmSelect is not involved with. As a 
result, I'm
wondering if you are reporting a Firefox issue rather than an asmSelect issue?

I should mention that Firefox can do some strange things to radio buttons and 
select
multiple fields when reloading, regardless of asmSelect or anything else.

Ryan

Original comment by ryancram...@gmail.com on 18 Sep 2008 at 9:27

GoogleCodeExporter commented 8 years ago
I see... Excuse me if I was not specific. And yes, i'm sure that is an issue 
related
with asmSelect. Because there is an issue that is not listed in the know issues 
I
reported it to you.

I tested with the following cases to be sure:

1) A page with radio buttons WITHOUT a asmSelect in the same form. The seletion 
of
the radio buttons doesn't change it when refresh/reload and submitting the 
form(with
default values and without default values).

2) A page with radio buttons WITH asmSelect present in the same form. The 
selection
changes in the radio buttons when refresh/reloadn AND submitting the form EVEN 
if set
the default value.

I tried the same in Internet Explorer 6/7 and Opera 9+. This issue only happen 
in
FireFox and with asmSelect present.

I attach the file where I conducted the tests (in PHP). 

I hope that you can review it and fix it. I think is very important to fix 
because if
you're planning to build a form with radio button and we want to show some 
errors or
indications in the same page, and the user will not notice the change when he 
click
on "submit" or F5.

Original comment by apanca...@gmail.com on 22 Sep 2008 at 7:17

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for posting the example. I'm sorry to have not gotten back to you 
sooner, I
didn't see this post until today when I was updating the site. You bring up a 
good
point, and one which is a strange behavior with Firefox which I didn't totally
understand until recently. 

The issue is caused by Firefox's "autocomplete" feature. This is not specific to
asmSelect ... any time you make a change to a form where a field is added or 
removed,
it completely confuses Firefox's autocomplete upon reload. For example, lets 
take
asmSelect out of the equation completely and just insert a simple text field:

http://www.ryancramer.com/projects/asmselect/examples/autocomplete.html

Note that the selected radio button changes with each reload. View the page 
source to
see more detail. It appears that Firefox's "autocomplete" feature makes the
assumption that form fields are not going to be added or removed from the page 
by
javascript. 

I don't know of any way to get around this other than turning off Firefox's
autocomplete feature. You can do so from the <form> tag, by setting the
"autocomplete" attribute to "off". i.e. <form autocomplete="off">. This is an 
easy
way to do it, but it's not XHTML compliant. As a result, you may want to do it 
with
jquery:

http://www.ryancramer.com/projects/asmselect/examples/autocomplete_fix.html

Perhaps I should add this to asmSelect, but I'm not sure that it's a good idea 
for me
to make this assumption since this applies only to specific cases. As a result, 
I
think that what I will do is provide more explanation for this in the 
documentation,
just in case anyone else ever encounters this Firefox behavior.  

Thanks,
Ryan

Original comment by ryancram...@gmail.com on 29 Nov 2008 at 7:37

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
For more detail, I've added an article about this issue on my site: 
http://www.ryancramer.com/journal/entries/radio_buttons_firefox/

Original comment by ryancram...@gmail.com on 21 Dec 2008 at 5:51