javascript - PHP doesn't process the form -
i'm having little problem here.
have form jquery disables submit input when form submited.
the problem is: use php process data when input submit clicked. apparently button being disabled first, php can not perform processing. need find way prevent this, take in code snippets:
<form class='send' action='{$_server['php_self']}' method='post'> <!--form data--> <input type='submit' name='finish' value='send'/> </form>
jquery function disable:
$('.send').on('submit', function() { $(this).find('input[type="submit"]').prop("disabled", true); });
and php code process:
if(isset($_post['finish'])) { //do things }
as said, php don't process form because js disabled button prevent multiple submitions. how process php before disable button? thanks!
since disabling submit button not send on to server in $_post
variable code doesn't work, have said.
another way looking create hidden html input
<input type="hidden" name="form">
then when check if form send, use
if(isset($_post['form'])) { //do things }
Comments
Post a Comment