function save_team()
{
$('#saveBtn').unbind('click');
$.ajax(
{
type: "POST",
url: "save.php",
data: { team_Array : t_pls },
success: function(data) {
$('#msg').text(data);
}
});
}
<input type="submit" value="SAVE" id="saveBtn" onclick="save_team()">
I searched, found some solutions, but they dont work. how to prevent SAVE button/onclick event from firing twice?? i'm trying to save team of 10 players in mysql. If team is same and onclick event occurs nothing should happen. Someone suggested me to do this in the PHP script (in my case save.php). But i couldn't think of perfect solution.
I think i have to do this using php. When team doesnt change, onclick event should be disabled and when team does change ajax call should be made and team should be saved in DB. So, one() call or disable attr. wont help here. pls suggest some php script help.