i have a project on PHP, MySQL and using the CodeIgniter Framework, i have a page where the user submits an order, but the problem is that it takes a while for the system to process it and in the meantime if the user presses the submit button it will be submitted again.
What i am trying to do is to disable the button once it is pressed. Here is the button code
<div class="row">
<div class="col-md-7">
<!-- begin panel -->
<input type="hidden" name="order_status" value="0" />
<button type="submit" class="btn btn-success saveit saveorderf_"><?php echo "Save";?></button>
<!-- end panel -->
</div>
</div>
What i have tried so far is using the
onClick="this.disabled=true;
but it only disables the button with out the form being submitted.
Any ideas what i might be missing here .
Thanks in advance.
You can replace your code with this:
the
form.submit();
will do the job for you