gpt4 book ai didi

javascript - 未捕获的范围错误: Maximum call stack size exceeded - Bootstrap Validate

转载 作者:行者123 更新时间:2023-12-02 17:14:54 24 4
gpt4 key购买 nike

我的表单出现上述错误:使用 Bootstrap Validator 时,我对以下 HTML 和 JavaScript 没有任何问题。

HTML:

<div class="form-group">
<label class="col-lg-3 control-label">Delivery Agent</label>
<div class="col-lg-5">
<select name="delivered_by" class="form-control">
<option value="">-- Select --</option>
<option value="8">Captain America</option>
<option value="12">Iron Man</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">No of bottles out for delivery</label>
<div class="col-lg-5">
<input type="text" value="" class="form-control" maxlength="3" name="bottles_out_for_delivery">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label">No of bottles returned</label>
<div class="col-lg-5">
<input type="text" value="" class="form-control" maxlength="3" name="bottles_returned">
</div>
</div>

JavaScript:

$('#add_bulk_delivery_form').bootstrapValidator({
fields: {
bottles_out_for_delivery: {
validators: {
notEmpty: {
message: 'Bottles out for delivery field can\'t be empty'
},
regexp: {
regexp: /^[0-9]+$/,
message: 'Bottles out for delivery can only contan numbers'
}
}
},
bottles_returned: {
validators: {
notEmpty: {
message: 'Bottles out for delivery field can\'t be empty'
},
regexp: {
regexp: /^[0-9]+$/,
message: 'Bottles out for delivery can only contan numbers'
}
}
},
delivered_by: {
validators: {
notEmpty: {
message: 'Please choose a delivery agent'
}
}
}
}
});

但是当我将以下 HTML 代码添加到该表单时,它会显示该错误。

<input type="text" maxlength="3" value="0" class="form-control" name="bottles_delivered[]">
<input type="text" maxlength="3" value="0" class="form-control" name="empty_bottles_collected[]">

最佳答案

我也遇到了类似的问题。这个解决方案对我有用:Maximum call stack size exceeded when changing a class - Bootstrap, jQuery

您必须验证表单的结构:http://formvalidation.io/getting-started/#writing-form

关于javascript - 未捕获的范围错误: Maximum call stack size exceeded - Bootstrap Validate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24529876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com