[英]Wizard submit button problem, I think this form wizard problem in js
Submit Button not work on this wizard, I think this form wizard problem in js.提交按钮在这个向导上不起作用,我认为这个表单向导在 js 中有问题。 When i click submit button but not work.当我单击提交按钮但不起作用时。 Then I inspect the submit button, there was a submit button code like this...然后我检查提交按钮,有一个像这样的提交按钮代码......
<a href="#finish" role="menuitem">Sumit</a>
But i need button type submit.但我需要按钮类型提交。 Please help me to solve it...请帮我解决它...
Check this problem here: sdaminul.com/wizard/this.html在此处检查此问题:sdaminul.com/wizard/this.html
Html HTML
<form action="form.php" id="wizard">
<h2></h2>
<section>
<div>
<div class="mt-4">
<h4 class="text-center mb-4">Tell us about Yourself</h4>
<div class="default-form contact-form">
<div class="form-group">
<input type="text" name="name" value="" placeholder="First Name" required>
</div>
<div class="form-group">
<input type="text" name="name2" value="" placeholder="Last Name" required>
</div>
<div class="form-group">
<input type="date" name="dob" id="dateofbirth">
</div>
</div>
</div>
</div>
</section>
<h2></h2>
<section>
<div class="inner">
<div class="mt-4">
<h4 class="text-center mb-4">Language</h4>
<div class="tags-default mb-4">
<input type="text" name="lang" value="English" data-role="tagsinput" placeholder="add language" />
</div>
</div>
</div>
</section>
<h2></h2>
<section>
<div class="inner">
<div class="mt-4">
<h4 class="text-center mb-4">Address</h4>
<div class="default-form contact-form">
<div class="form-group">
<input type="text" name="address1" value="" placeholder="Address 1" required>
</div>
<div class="form-group">
<input type="text" name="address2" value="" placeholder="Address 2" required>
</div>
</div>
</div>
</div>
</section>
</form>
and this is form wizard javascript code.这是表单向导 javascript 代码。 JS JS
(function($) {
$("#wizard").steps({
headerTag: "h2",
bodyTag: "section",
transitionEffect: "fade",
enableAllSteps: true,
transitionEffectSpeed: 700,
labels: {
finish: "Submit",
next: "Next",
previous: "Previous"
}
});
$('.wizard > .steps li a').click(function(){
$(this).parent().addClass('checked');
$(this).parent().prevAll().addClass('checked');
$(this).parent().nextAll().removeClass('checked');
});
// Custome Jquery Step Button
$('.forward').click(function(){
$("#wizard").steps('next');
})
$('.backward').click(function(){
$("#wizard").steps('previous');
})
// Select Dropdown
$('html').click(function() {
$('.select .dropdown').hide();
});
$('.select').click(function(event){
event.stopPropagation();
});
$('.select .select-control').click(function(){
$(this).parent().next().toggle();
})
$('.select .dropdown li').click(function(){
$(this).parent().toggle();
var text = $(this).attr('rel');
$(this).parent().prev().find('div').text(text);
})
})(window.jQuery);
<a href="#finish" role="menuitem">Sumit</a>
This will not submit your form unless it have a type="submit"
这不会提交您的表单,除非它有一个type="submit"
You can trigger your form by adding type="submit"
or manually trigger it via jQuery
您可以通过添加type="submit"
或通过jQuery
手动触发它来触发您的表单
$('[href="#finish"]').click(function() {
$('#wizard').submit();
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.