I have a select menu with two options that are settings for my website. Instead of having a save button, I want it to save to the db when the new value is selected. Right now I have setup a .click function in my jquery file that achieves this purpose for the most part. The only problem is that if you click the drop down arrow (like click down and then back up) it counts that as a cli开发者_运维百科ck and begins saving to the db.
Is there a way I can make it so that it begins saving only when one of the options in the select menu is selected? or maybe even if only a different value is selected? Any help is greatly appreciated! Thanks
You can bind to the change
event, but different browsers trigger that at different times (as soon as it's changed, or after the user navigates away from the drop down). Something to be aware of, but it works pretty well.
精彩评论