![]() ![]() Use a KVO (key-value observer) plugin like my Backbone.ModelBinding and let it deal with that for youįor the quick-fix to get my site working properly, I went with the combination of “change” and “keyup” events.Delay reading the data until the user clicks the “Purchase” button. ![]() Use a combination of “blur”, “change”, and “keyup” events.There are a number of very easy ways to fix this. In the above screenshot, since i had typed “deri” in to the email address, the email that is stored in the Backbone model would only be “deri” – and that’s obviously not a valid email address. ![]() This resulted in the data being truncated when it populated my Backbone model. It fires the “change” event for the things it fills in, but not “keyup”. It saves me a few seconds here and there and generally makes it easier for me to fill in the same repetitious information across websites.īut there’s a problem with auto-fill. Most (if not all) browsers have an auto-fill feature, these days. #Jquery on keyup code#To “fix” the problem, I switched my code from a “change” event to a “keyup” event for the text boxes … bad idea! Browser Auto-Fill In that scenario, a potential customer would have to modify each field, even though they were already filled in, in order for my Backbone code to see the data in the field. I was trying to fix a scenario where a browser cache would have some of the data in the purchase form already filled in. It was a Friday.Ī few days ago I pushed some changes to the form validation up to my WatchMeCode website. Don’t Rely Solely On jQuery’s “keyup” Event 27 January, 2012. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |