Hi,
This is Atit here. I am working on Ruby on Rails. I have one
functionality in which, I have two drop down. Second drop down list is
dependent on first one. So changing value of first drop down is
refreshing the second drop down. I have used observe_field to
implement this functionality. This is working fine in Fire Fox but in
IE 6.0 it is not populating second drop down every time.
I read in on of the blog and I have made changes in
prototype.js to get it worked. I have added code mentioned below in
Event Observer function of protype.js file.
Previously my prototype.js like this
registerCallback: function(element) {
if (element.type) {
switch (element.type.toLowerCase()) {
case ''checkbox'':
case ''radio'':
Event.observe(element, ''click'',
this.onElementEvent.bind(this));
break;
default:
Event.observe(element, ''change'',
this.onElementEvent.bind(this));
break;
}
I have added event for select box, text box and now it looks like
registerCallback: function(element) {
if (element.type) {
switch (element.type.toLowerCase()) {
case ''checkbox'':
case ''radio'':
Event.observe(element, ''click'',
this.onElementEvent.bind(this));
break;
case ''password'':
case ''text'':
case ''textarea'':
Event.observe(element, ''change'',
this.onElementEvent.bind(this));
break;
case ''select-one'':
Event.observe(element, ''change'',
this.onElementEvent.bind(this));
Event.observe(element, ''click'',
this.onElementEvent.bind(this));
break;
case ''select-multiple'':
Event.observe(element, ''change'',
this.onElementEvent.bind(this));
Event.observe(element, ''click'',
this.onElementEvent.bind(this));
break;
default:
Event.observe(element, ''change'',
this.onElementEvent.bind(this));
break;
}
But still it is not populating my dropdown every time. I have checked
in my log but it is not showing anything. It looks like it is not
submitting request sometime.
I have tried with prototype.js 1.6 new candidate release also but have
no success.
Request you to help me. Thanks in advance.
Thanks and Regards
Atit Shah
4951 Lake Brook Dr
Hilb Rogal & Hobbs
Mailto:atit.shah-xohvtl3ozRo@public.gmane.org
Direct: 804 747 3177
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---