jQuery Submit is not submitting value of button on .submit();
I just wanted to show a confirm bootstrap popup onclick of submit btn.
But using jQuery .submit() form element "Submit" value is empty.
HTML markup:
<form class="form-horizontal" rel="opsform" data-validate="true" role="form" name="frmsetsku" id="frmsetsku" method="post" novalidate="novalidate">
//my input elements
<button class="btn btn-primary btn-sm mr6 " name="Submit" id="btn-action-save" value="Save" type="submit" onclick="return submitSku();"><i class="fa fa-floppy-o bigger-115 ace-icon"></i>Save</button>
</form>
jQuery code:
function submitSku() {
event.preventDefault();
bootbox.confirm("This Will Delete All Previous SKU and add Newly Entered SKUs ", function(result) {
dialog = this;
if(result) {
document.getElementById("frmsetsku").submit();
}
});
}
PHP code:
$submit = initRequestValue('Submit');
//my initPostValue allows me to take post value by name
If I remove jQuery, the code is working fine but I add my jQuery submit value is not received.
bootboxobject?onclickevent to submit the form, then change the button type tobutton, instead ofsubmit.