【发布时间】:2016-01-14 16:55:04
【问题描述】:
我遇到了jQuery Steps 插件的问题。 下一步按钮必须在执行特定操作之前禁用,如果数据得到正确验证,则应该启用它。
所以问题是:如何将 next 按钮设置为默认禁用,是否有可用的方法以编程方式启用或禁用 next 按钮?
这是我当前的代码:
HTML:
<div id="steps">
<h3>Write question</h3>
<section>
<input type="text" id="question" placeholder="Question goes here">
<button id="save">Save and do something else</button>
</section>
<h3>Preview</h3>
<section>
<p id="preview"></p>
</section>
<h3>Done</h3>
<section>
<p>Congratulations text goes here</p>
</section>
</div>
jQuery:
//start
$(function(){
$('#steps').steps({
headerTag: "h3",
bodyTag: "section",
transitionEffect: "slideLeft",
stepsOrientation: "vertical"
});
$('#save').click(function(){
$('#preview').html($('#question').val());
//do something else (ajax wise, etc)
if(true) {
//enable NEXT button here...
}
});
});
【问题讨论】:
标签: jquery jquery-steps