Hi Hans,

On Wed, Jan 11, 2012 at 10:35 AM, Hans <[email protected]> wrote:
> I tries to observe a change  in a field  with jquery in Rails 3.1 in
> order to be able to implement  two cascading select boxes.
> A a first step I just try to observe a click in a div using jquery
> I have the following function in a .js file that is loadedin the head
> section (fieldset is the id of a div) and is displaying a view with
> the div fieldset
>
> $(document).ready(function() {
> $('#fieldset').bind({
>  click: function() {
>        alert('Change');
>    // do something on click
>  },
>  mouseenter: function() {
>    // do something on mouseenter
>  };
> });
>  });
> But nothing happens when I click in the field
> I suspect that I am using jquery  in the wrong way

Try giving it an id of a different name.  My guess is that jquery is
'confused' by your use of 'fieldset' as an id because it is also a tag
name.

HTH,
Bill

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to