Skip to content

Change Event Fires Multiple time #270

Open
@johnwswar

Description

@johnwswar

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		  
	   });

});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions