后端-活动管理页面图片必填校验
This commit is contained in:
parent
1363e520dc
commit
ec73e474ce
|
|
@ -1121,6 +1121,8 @@
|
||||||
// 该事件在离开某个步骤之前触发
|
// 该事件在离开某个步骤之前触发
|
||||||
$("#smartwizard").on("leaveStep", function (e, anchorObject, currentStepNumber, nextStepNumber, stepDirection) {
|
$("#smartwizard").on("leaveStep", function (e, anchorObject, currentStepNumber, nextStepNumber, stepDirection) {
|
||||||
if (stepDirection == 'forward') {
|
if (stepDirection == 'forward') {
|
||||||
|
var form = $("#step-" + (currentStepNumber + 1)).find('.form');
|
||||||
|
console.log(form);
|
||||||
return $("#step-" + (currentStepNumber + 1)).validate({
|
return $("#step-" + (currentStepNumber + 1)).validate({
|
||||||
errorPlacement: function(error, element) {
|
errorPlacement: function(error, element) {
|
||||||
error.appendTo(element.parent().parent().parent());
|
error.appendTo(element.parent().parent().parent());
|
||||||
|
|
|
||||||
|
|
@ -375,18 +375,18 @@
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-4 control-label is-required">背景图片:</label>
|
<label class="col-sm-4 control-label is-required">背景图片:</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="fileinput fileinput-new" data-provides="fileinput">
|
<div class="fileinput fileinput-exists" data-provides="fileinput">
|
||||||
<div class="fileinput-preview thumbnail" data-trigger="fileinput"
|
<div class="fileinput-preview thumbnail" data-trigger="fileinput"
|
||||||
style="width: 220px; height: 150px;">
|
style="width: 220px; height: 150px;">
|
||||||
<img th:src="*{actPageConfigGuide.bgImg}">
|
<img th:src="*{actPageConfigGuide.bgImg}" >
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span class="btn btn-white btn-file"><span
|
<span class="btn btn-white btn-file"><span
|
||||||
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
||||||
<input type="file" id="pic" name="actPageConfigGuide-bgImg"
|
<input type="file" id="pic" name="actPageConfigGuide-bgImg" th:value="*{actPageConfigGuide.bgImg}"
|
||||||
onchange="syncPic(this)" required></span>
|
onchange="syncPic(this)"></span>
|
||||||
<a href="#" class="btn btn-white fileinput-exists"
|
<a href="#" class="btn btn-white fileinput-exists"
|
||||||
data-dismiss="fileinput">清除</a>
|
data-dismiss="fileinput" onclick="clecreq('pic')">清除</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -651,9 +651,9 @@
|
||||||
<span class="btn btn-white btn-file"><span
|
<span class="btn btn-white btn-file"><span
|
||||||
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
||||||
<input type="file" id="picture" name="actPageConfigUserinfo-bgImg"
|
<input type="file" id="picture" name="actPageConfigUserinfo-bgImg"
|
||||||
onchange="syncPic(this)" required></span>
|
onchange="syncPic(this)" th:value="*{actPageConfigUserinfo.bgImg}"></span>
|
||||||
<a href="#" class="btn btn-white fileinput-exists"
|
<a href="#" class="btn btn-white fileinput-exists"
|
||||||
data-dismiss="fileinput">清除</a>
|
data-dismiss="fileinput" onclick="clecreq('picture')">清除</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -827,10 +827,10 @@
|
||||||
<div>
|
<div>
|
||||||
<span class="btn btn-white btn-file"><span
|
<span class="btn btn-white btn-file"><span
|
||||||
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
||||||
<input type="file" id="shareImg" name="actConfig-shareImg"
|
<input type="file" id="shareImg" name="actConfig-shareImg" th:value="*{actConfig.shareImg}"
|
||||||
onchange="syncPic(this)" required></span>
|
onchange="syncPic(this)"></span>
|
||||||
<a href="#" class="btn btn-white fileinput-exists"
|
<a href="#" class="btn btn-white fileinput-exists"
|
||||||
data-dismiss="fileinput">清除</a>
|
data-dismiss="fileinput" onclick="clecreq('shareImg')">清除</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input id="shareImgval" type="hidden" name="actConfig-shareImg" value=""
|
<input id="shareImgval" type="hidden" name="actConfig-shareImg" value=""
|
||||||
|
|
@ -886,10 +886,10 @@
|
||||||
<span class="btn btn-white btn-file"><span
|
<span class="btn btn-white btn-file"><span
|
||||||
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
||||||
<input type="file" id="backdropImg"
|
<input type="file" id="backdropImg"
|
||||||
name="actPageConfigSubscribe-bgImg" onchange="syncPic(this)"
|
name="actPageConfigSubscribe-bgImg" onchange="syncPic(this)" th:value="*{actPageConfigSubscribe.bgImg}"
|
||||||
required></span>
|
></span>
|
||||||
<a href="#" class="btn btn-white fileinput-exists"
|
<a href="#" class="btn btn-white fileinput-exists"
|
||||||
data-dismiss="fileinput">清除</a>
|
data-dismiss="fileinput" onclick="clecreq('backdropImg')">清除</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -913,10 +913,10 @@
|
||||||
<span class="btn btn-white btn-file"><span
|
<span class="btn btn-white btn-file"><span
|
||||||
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
class="fileinput-new">选择图片</span><span class="fileinput-exists">更改</span>
|
||||||
<input type="file" id="qrCodeImg"
|
<input type="file" id="qrCodeImg"
|
||||||
name="actPageConfigSubscribe-bgImg2" onchange="syncPic(this)"
|
name="actPageConfigSubscribe-bgImg2" onchange="syncPic(this)" th:value="*{actPageConfigSubscribe.qrCode}"
|
||||||
required></span>
|
></span>
|
||||||
<a href="#" class="btn btn-white fileinput-exists"
|
<a href="#" class="btn btn-white fileinput-exists"
|
||||||
data-dismiss="fileinput">清除</a>
|
data-dismiss="fileinput" onclick="clecreq('qrCodeImg')">清除</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1255,6 +1255,8 @@
|
||||||
// 该事件在离开某个步骤之前触发
|
// 该事件在离开某个步骤之前触发
|
||||||
$("#smartwizard").on("leaveStep", function (e, anchorObject, currentStepNumber, nextStepNumber, stepDirection) {
|
$("#smartwizard").on("leaveStep", function (e, anchorObject, currentStepNumber, nextStepNumber, stepDirection) {
|
||||||
if (stepDirection == 'forward') {
|
if (stepDirection == 'forward') {
|
||||||
|
var form = $("#step-" + (currentStepNumber + 1)).context.forms;
|
||||||
|
console.log(form);
|
||||||
return $("#step-" + (currentStepNumber + 1)).validate({
|
return $("#step-" + (currentStepNumber + 1)).validate({
|
||||||
errorPlacement: function(error, element) {
|
errorPlacement: function(error, element) {
|
||||||
error.appendTo(element.parent().parent().parent());
|
error.appendTo(element.parent().parent().parent());
|
||||||
|
|
@ -1374,6 +1376,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//补丁,添加必填校验
|
||||||
|
function clecreq(val){
|
||||||
|
$('#'+val).attr("required","true");
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue