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

Change Event Fires Multiple time #270

Open
johnwswar opened this issue Nov 13, 2019 · 1 comment
Open

Change Event Fires Multiple time #270

johnwswar opened this issue Nov 13, 2019 · 1 comment

Comments

@johnwswar
Copy link

johnwswar commented Nov 13, 2019

When an user changes the value in a class="change_dropdown" the ajax fires multiple times. How can I resolve this?

When I use the debugger, it first displays change_dropdown="" first then after 3th time, it sends the correct value.

$('.change_dropdown).change(function(e) {

var id = $(this).closest('tr').attr('id');
var dt = new Date();
var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds();

$.ajax({
type: "POST",
url: "update_data.cfm",
data: {id:id},
success: function (response) {
},

	  error: function (xhr, ajaxOptions, thrownError) {
	  	$("#last_updated").text("Current Update NOT Successful on "+time)
		alert(thrownError);			
	  },
	  	cache: false		  
	   });

});

@tiesont
Copy link
Collaborator

tiesont commented Nov 13, 2019

Sounds like a dup of #268 - probably want to check the solution shown in #269

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