Hello my lovely stackies,
After alot of research and no working solution I thought I would try my luck here. I have a button which POST a formular of a user to the my server. But my huge problem is, when the user clicks the button how much he wants, I get the formular as often as he clicked on it.
My button and send function is:
echo "<form name=\"myForm\" method=\"POST\" action=\"aktenerfassung.php?id=$id&mandnr=$mandnr&countBeleg=$countBeleg\">
";
echo "<p align=\"center\"><input id=\"absenden\" align=\"center\" type=\"submit\" value=\"Fehler korrigieren\" name=\"B1\"></p>
";
echo "</form>
";
unset($clsAktenerfassung);
My solution would be:
$(function() {
$('absenden').on('click', function(e) {
var trigger = $(this),
clickCount = trigger.data('clickCount');
clickCount++;
trigger.data('clickCount', clickCount);
}
if(clickCount > 1) {
alert('schon einmal klicken')
}
});
But I can still press the button how much I want and still don't get a alert. I dont even get a error message from PHP.
This should be the alert:
if(clickCount > 1) {
alert('schon einmal klicken')
}
If anything is unclear or you need other information or this post already exists in stackoverflow, please tell me.
Thank you already!!