我正在使用 jquery 步骤向用户显示表单,但我遇到了 content 属性的一些奇怪问题。
如果我" "
在一行代码中同时拥有这两个步骤,那么这些步骤将起作用。
但是,如果我"
通过添加另一个输入字段将结束移动到另一行,则不会呈现这些步骤。
$("#wizard").steps({
headerTag: "h3",
bodyTag: "fieldset",
transitionEffect: "slideLeft",
onStepChanging: function(event, currentIndex, newIndex) {
//only apply to first step
if (currentIndex === 0 && ($("#workType > option:selected").val()) === "1") {
$("#wizard").steps("insert", 1, {
title: "Construction Details",
content: "<input type='text' name='budget' id='budget' placeholder='What is your budget?'><br/>"
});
}
});
所以这有效:
content: "<input type='text' name='budget' id='budget' placeholder='What is your budget?'><br/>"
这不会:
content: "<input type='text' name='budget' id='budget' placeholder='What is your budget?'>
<input type='text' name='timeline' id='timeline' placeholder='When do you want to start?'>
<br/>"
内容是否需要全部放在一行上还是我做错了什么?TIA