when form submit and if validation triger true than its display error on form.submit();
submitHandler: function(form) {
debug: true,
success1.show();
error1.hide();
form.submit();
}
form html like this
<form method="post" id="clientordeR_create12" onsubmit="enableItemtax();"
action="<?php echo base_url('Clientorder/save'); ?>">
all input eliments here
<input type="submit" name="submit" class="btn green"
value="Save & Print" formtarget="_blank" id="spSlip"/>
</form>
when form submit and if validation triger true than its display error on form.submit();
submitHandler: function(form) {
debug: true,
success1.show();
error1.hide();
form.submit();
}
form html like this
<form method="post" id="clientordeR_create12" onsubmit="enableItemtax();"
action="<?php echo base_url('Clientorder/save'); ?>">
all input eliments here
<input type="submit" name="submit" class="btn green"
value="Save & Print" formtarget="_blank" id="spSlip"/>
</form>
Share
Improve this question
edited Mar 15, 2023 at 7:22
AndrewL64
16.3k8 gold badges50 silver badges85 bronze badges
asked Jan 11, 2019 at 10:16
patel jaypatel jay
1352 silver badges13 bronze badges
3
|
2 Answers
Reset to default 18You most probably have a button or input in your form with id="submit"
and/or name="submit"
like this:
<form>
<input type="text" name="someName" />
<input type="email" name="someEmail" />
<!-- Other form elements -->
<button type="submit" name="submit" id="submit">Submit</button>
</form>
This will change form.submit()
to a field reference rather than a method call. You can verify this by console logging form.submit()
which will most probably return the <button type="submit" name="submit" id="submit">Submit</button>
element instead.
To fix this, you need to either remove the id="submit"
and/or name="submit"
attributes or change them to something else like this:
<form>
<input type="text" name="someName" />
<input type="email" name="someEmail" />
<!-- Other form elements -->
<button type="submit" name="submitBtn" id="submitBtn">Submit</button>
</form>
simply change input type submit or button type submit name = submit to othername and id name also same as name
<input type="submit" name="submit" id= "save" class="btn green">
change to like this and error solved in my case
<input type="submit" name="save" id= "save" class="btn green">
if (typeof(form) == <SOME_TYPE>) {form.submit()}
– user11367277 Commented Jan 11, 2019 at 10:31