Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add a change trigger to the target. #35

Closed
rh0dium opened this issue Nov 20, 2012 · 3 comments
Closed

Please add a change trigger to the target. #35

rh0dium opened this issue Nov 20, 2012 · 3 comments

Comments

@rh0dium
Copy link

rh0dium commented Nov 20, 2012

Hi there,

I'm trying to do some ajax work after your field gets filled but changes in value of hidden elements don't automatically fire the .change() event. Would it be possible to change your triggers from 'added' and 'killed' to simply 'changed'? I'm not sure where 'added' or 'killed' is documented as standard event types but I couldn't find any references http://api.jquery.com/category/events/ [here] or http://www.quirksmode.org/dom/events/ [here].

Thanks!!

@crucialfelix
Copy link
Owner

"killed" is definitely a bit idiosyncratic. 'removed' would have been better

but 'changed' is for models and this isn't a model. and if it was for both added/killed then you lose information and would have to differentiate them.

you should be able to subscribe to any message you like. message names aren't a fixed list, its open to define them for your application as you like.

in any case ... massive breakage for everybody else.

@rh0dium
Copy link
Author

rh0dium commented Nov 20, 2012

Fair enough - even as I wrote it I was thinking the same thing. Thanks for the reply.

@crucialfelix
Copy link
Owner

sure thing. btw. I should update the docs since now "on" is better than "bind"

{% block extra_script %}
    $('#{{ html_id }}').on('added',function() {
          // and I think *this* is set inside here to the element

// so this part should just be $(this).val() or this.val()
entered = $('#{{ html_id }}').val();
alert( entered );
});
{% endblock %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants