Open twanlass opened 9 years ago
Not sure I follow - the subject suggests there's a problem with input[type=hidden]
, but there isn't one...
@remy my apologies - fixed the title, forgot to save.
Re: the jsfiddle above - wondering what I'm doing wrong or if this functionality is not implemented. I've got a few places where the input values are modified via jQuery et el but not seeing the binding update (no callback fired when changed etc).
Cheers!
-t
I see a use case for that, when bind.js is used in a larger application, but you could still set the value programmatically in your example:
Instead of $('.name').val('tyler');
you use names.name = 'tyler';
instead.
Oh, I think I follow now. Are you expecting the bound object to update when you change the input using jQuery?
If that's the case, I'm pretty sure you want to trigger a change event on the input element, since that's how bind.js is picking up the change.
$('input.name').val('tyler').trigger('change');
@twanlass did that work?
@remy - calling trigger('change')
doesn't appear to, no.
trigger('change')
doesn't do the trick, any ideas?
For example, why doesn't this work? https://jsfiddle.net/k25zfbm7/