我有模态,当我点击添加账单按钮时,它会弹出sweetalert2,下面提供的代码来自他们的文档,所以我认为代码没有问题,无论如何,我的问题是输入不能通过键入就像残疾人一样,这是materializecss方面的问题吗?
Ps我正在使用一个materializecss css框架,我还阅读了一篇文章,它在引导框架中与我有同样的问题。
https://github.com/sweetalert2/sweetalert2/issues/374
$(".btnAddBills").click(function(event) {
swal.mixin({
input: 'text',
confirmButtonText: 'Next →',
showCancelButton: true,
progressSteps: ['1', '2', '3']
}).queue([
{
title: 'Question 1',
text: 'Chaining swal2 modals is easy'
},
'Question 2',
'Question 3'
]).then((result) => {
if (result.value) {
swal({
title: 'All done!',
html:
'Your answers: <pre><code>' +
JSON.stringify(result.value) +
'</code></pre>',
confirmButtonText: 'Lovely!'
})
}
})
Run Code Online (Sandbox Code Playgroud)
});
这是代码。当我尝试使用输入类型重置时,它不起作用。我试图将其删除到 div 之外,但仍然无法正常工作。
<div class="container-fluid">
<div class="row">
<div class="col s4"></div>
<div class="col s4">
<form class="form" action="<?=base_url()?>item/updatedata/<?=$this->uri->segment(3)?>" method="POST">
<div class="row">
<label>ITEM ID</label>
<input type="text" readonly="" value="<?=$items->item_id?>" class="validate">
<label>ITEM NAME</label>
<input type="text" value="<?=$items->item_name?>" name="item_name" class="validate">
<label>ITEM DESCRIPTION</label>
<input type="text" value="<?=$items->item_desc?>" name="item_desc" class="validate">
<label>ITEM PRICE</label>
<input type="text" value="<?=$items->item_price?>" name="item_price" class="validate">
<div class="col s6">
<button class="btn waves-effect waves-light " type="submit" value="SUBMIT">Submit
<i class="material-icons right">send</i>
</button>
</div>
<div class="col s6">
<input class="btn waves-effect waves-light red" type="reset" value="Reset">
</div>
</div>
</form>
</div>
<div class="col s4"></div>
</div> …Run Code Online (Sandbox Code Playgroud)