<body>
<!-- 遮罩层 -->
<div id="hidediv"
style="width: 100%;height: 100%;background-color: #808080;z-index: 99999;display: none;opacity:0.5;position: absolute;"></div>
<div id="main_login">
<s:include value="../../top.jsp">
<s:param name="menuTitle">兼职人员工资结算方式-编辑</s:param>
</s:include>
<div class="content_login">
<div class="line_bottom padding_style1">
<a href="javascript:history.back(-1)"><i class="icon-backward"></i>
返回</a>
</div>
<s:form id="form" action="%{#request['struts.actionMapping'].name}"
theme="bootstrap" cssClass="form-horizontal m_top col-md-8">
<s:hidden name="id"></s:hidden>
<input type="hidden" id="ceoId" name="ceoId" value="${ceo }"/>
<input type="hidden" id="riderId" name="riderId" value="${rider }">
<input type="hidden" id="type" name="type" value="${ceoCommissionType }">
<!-- 工资结算方式(骑手/楼长) -->
<c:if test="${rider eq 1 }">
<div class="control-group form-group">
<label for="工资结算方式" class="col-md-2 control-label">工资结算方式(骑手/楼长)</label>
<div class="col-md-9 checkbox checkbox-inline">
<label class="radio-inline"><input type="radio" name="commissionType" <s:if test="commissionType == 1">checked="checked"</s:if> value="1" onclick="riderChoose('1')"/>配送费分成</label>
<label class="radio-inline"><input type="radio" name="commissionType" <s:if test="commissionType == 2">checked="checked"</s:if> value="2" onclick="riderChoose('2')"/>营业额百分比分成</label>
<label class="radio-inline"><input type="radio" name="commissionType" <s:if test="commissionType == 3">checked="checked"</s:if> value="3" onclick="riderChoose('3')"/>配送费+营业额百分比分成</label>
</div>
</div> <div class="control-group form-group" id="distributionId" style="display: none;">
<label class="col-md-2 control-label">配送费分成(单位:%)</label>
<div class="col-md-9">
<input type="text" name="distributionPercent" value="${distributionPercent}" class="form-control" style="width: 100px"/>
<span class="help-block"><span class="label"></span></span>
<div class="controls"></div>
</div>
</div>
<div class="control-group form-group" id="stallsuctionId" style="display:none;">
<label class="col-md-2 control-label">营业额百分比分成(单位:%)</label>
<div class="col-md-9">
<c:choose>
<c:when test="${!empty riderList }">
<c:forEach items="${riderList }" var="rider" begin="0" varStatus="status">
<c:set value="${status.count-1 }" var="num"></c:set>
<div class="stall_money_rider_percent">
<input type="text" id="riderSettlementList[${num}].percent" name="riderSettlementList[${num}].percent" value="${rider.percent}" class="form-control stall_percent" style="width: 100px"/>${rider.stallName }
<input type="hidden" id="riderSettlementList[${num}].stallId" name="riderSettlementList[${num}].stallId" value="${rider.stallId }">
</div>
</c:forEach>
</c:when>
<c:otherwise>
<c:forEach items="${stallList }" var="stall" begin="0" varStatus="status">
<c:set value="${status.count-1 }" var="num"></c:set>
<div class="stall_money_rider_percent">
<input type="text" id="riderSettlementList[${num}].percent" name="riderSettlementList[${num}].percent" value="" class="form-control stall_percent" style="width: 100px"/>${stall.name }
<input type="hidden" id="riderSettlementList[${num}].stallId" name="riderSettlementList[${num}].stallId" value="${stall.id }">
</div>
</c:forEach>
</c:otherwise>
</c:choose>
</div>
</div>
</c:if> <!-- 工资结算方式(校园CEO) ceo抽佣方式:1:档口营业额分成,2:档口订单分成-->
<c:if test="${ceo eq 2 }">
<div class="control-group form-group">
<label for="工资结算方式" class="col-md-2 control-label">工资结算方式(校园CEO)</label>
<div class="col-md-9 checkbox checkbox-inline">
<label class="radio-inline"><input type="radio" name="ceoCommissionType" <s:if test="ceoCommissionType == 1">checked="checked"</s:if> value="1" onclick="ceoChoose('1')"/>营业额百分比分成</label>
<label class="radio-inline"><input type="radio" name="ceoCommissionType" <s:if test="ceoCommissionType == 2">checked="checked"</s:if> value="2" onclick="ceoChoose('2')"/>营业额订单固定分成</label>
</div>
</div>
<div class="control-group form-group" id="dividedIntoId" style="display: none;">
<label class="col-md-2 control-label">营业额订单固定分成(单位:元)</label>
<div class="col-md-9">
<c:choose>
<c:when test="${!empty ceoList }">
<c:forEach items="${ceoList }" var="ceo" begin="0" varStatus="status">
<c:set value="${status.count-1 }" var="num"></c:set>
<div class="stall_money_ceo_money">
<input type="text" id="ceoOrderSettlementList[${num}].money" name="ceoOrderSettlementList[${num}].money" value="${ceo.money}" class="form-control stall_money" style="width: 100px"/>${ceo.stallName }
<input type="hidden" id="ceoOrderSettlementList[${num}].stallId" name="ceoOrderSettlementList[${num}].stallId" value="${ceo.stallId }">
</div>
</c:forEach>
</c:when>
<c:otherwise>
<c:forEach items="${stallList }" var="stall" begin="0" varStatus="status">
<c:set value="${status.count-1 }" var="num"></c:set>
<div class="stall_money_ceo_money">
<input type="text" id="ceoOrderSettlementList[${num}].money" name="ceoOrderSettlementList[${num}].money" value="" class="form-control stall_money" style="width: 100px"/>${stall.name }
<input type="hidden" id="ceoOrderSettlementList[${num}].stallId" name="ceoOrderSettlementList[${num}].stallId" value="${stall.id }">
</div>
</c:forEach>
</c:otherwise>
</c:choose>
</div>
</div>
<div class="control-group form-group" id="turnoverId" style="display: none;">
<label class="col-md-2 control-label">营业额百分比分成(单位:%)</label>
<div class="col-md-9">
<c:choose>
<c:when test="${!empty ceoList }">
<c:forEach items="${ceoList }" var="ceo" begin="0" varStatus="status">
<c:set value="${status.count-1 }" var="num"></c:set>
<div class="stall_money_ceo_percent">
<input type="text" id="ceoSettlementList[${num}].percent" name="ceoSettlementList[${num}].percent" value="${ceo.percent}" class="form-control stall_percent" style="width: 100px"/>${ceo.stallName }
<input type="hidden" id="ceoSettlementList[${num}].stallId" name="ceoSettlementList[${num}].stallId" value="${ceo.stallId }"/>
</div>
</c:forEach>
</c:when>
<c:otherwise>
<c:forEach items="${stallList }" var="stall" begin="0" varStatus="status">
<c:set value="${status.count-1 }" var="num"></c:set>
<div class="stall_money_ceo_percent">
<input type="text" id="ceoSettlementList[${num}].percent" name="ceoSettlementList[${num}].percent" value="" class="form-control stall_percent" style="width: 100px"/>${stall.name }
<input type="hidden" id="ceoSettlementList[${num}].stallId" name="ceoSettlementList[${num}].stallId" value="${stall.id }"/>
</div>
</c:forEach>
</c:otherwise>
</c:choose>
</div>
</div>
</c:if> <div class="col-md-offset-2">
<a id="subUpdate" class="btn btn-default" style="margin-left: 80px;">保存</a>
</div>
</s:form>
</div>
</body>

js

        var type = $('input[name="type"]').val();
//骑手楼长营业额百分比分成
var flag = false;
$(".stall_money_rider_percent").each(function(){
var value = $(this).find(".stall_percent").val();
if(value==null || value==""){
flag=true;
return false;
}
});
if(flag){
alert('骑手楼长营业额百分比分成必填');
return;
}
//ceo营业额百分比分成
if(type==1){
$(".stall_money_ceo_percent").each(function(){
var value = $(this).find(".stall_percent").val();
if(value==null || value==""){
flag=true;
return false;
}
})
if(flag){
alert('ceo营业额百分比分成必填')
return;
}
}
//ceo营业额订单固定分成必填
if(type==2){
$(".stall_money_ceo_money").each(function(){
var value = $(this).find(".stall_money").val();
if(value==null || value==""){
flag = true;
return false;
}
});
if(flag){
alert('ceo营业额订单固定分成必填');
return;
}
}

根据class 属性判断所有的文本框必填的更多相关文章

  1. Enterprise Library +Caliburn.Micro+WPF CM框架下使用企业库验证,验证某一个属性,整个页面的文本框都变红的原因

    我用的是CM这个框架做的WPF,在用企业库的验证的时候,我用标签的方式给一个属性加了不能为空的验证,但整个页面的所有控件的外面框都变红了.原因是CM框架的绑定方式是直接X:Name="你的属 ...

  2. ASP.NET、WinForm - 判断整个页面文本框是否为空

    foreach(Control ctrl in Page.Controls) { foreach(Control childc in ctrl.Controls) { switch(childc.Ge ...

  3. 验证页面多个input文本的必填项

    前台页面 JS : function CheckMustWrite(){ var count = $("input[mustwrite = 'true']", document.f ...

  4. input文本框禁止修改文本——disabled和readonly属性的作用及区别

    1.input文本框禁止修改文本 disabled属性:<input type="text" name="name" value="xxx&qu ...

  5. 【kindeditor】KindEditor获取多个textarea文本框的值并判断非空

    kindeditor官网:http://kindeditor.net/demo.php 如何获取多个KindEditor中textarea文本框的值,方式很多种(带有HTML标签). var intr ...

  6. js/jquery获取文本框的值与改变文本框的值

    我们就用它来学习获取文本框的值及改变文本框的值. 代码如下 复制代码 <script>function get1(){ document.getElementById("txtb ...

  7. 使用 Windows 窗体 TextBox 控件创建密码文本框

    密码框是一种 Windows 窗体文本框,它在用户键入字符串时显示占位符. 创建密码文本框 将 TextBox 控件的 PasswordChar 属性设置为某个特定字符. PasswordChar 属 ...

  8. PDF文本框更改字体大小

    在Adobe Acrobat  Professional 7.0版本后里单击所插入的文本框,会出现文本框属性,此时只能改文本框的属性,不能修改文本框内的字体大小 要改字体很简单,左键选中要改的文本,按 ...

  9. 文本框input:text

      文本框 CreateTime--2017年4月24日10:40:40 Author:Marydon 一.文本框 (一)标签 <input type="text"/> ...

随机推荐

  1. python文件读取:遇见的错误及解决办法

    问题一: TypeError: 'str' object is not callable 产生原因: 该错误TypeError: 'str' object is not callable字面上意思:就 ...

  2. BFS与食物链条数

    最近学校生物在教能量流动,因此离不开食物网,也就离不开食物链. 那么问题来了,给出食物网(DAG),怎么求食物链条数呢? 怎么来的?首先,找到同时被2个以上生物捕食的被捕食者,求出:能量来源X(能量去 ...

  3. 1.4、WebRTC源码

    文章导读:本篇文章给读者展示WebRTC的源码目录结构,为读者构建全方位的知识体系,如果你有兴趣下载webrtc的源码来编译运行,本节内容可以作为你了解源码的简要说明书,webrtc源码非常庞大的,讲 ...

  4. 【Python】使用socketserver建立一个异步TCP服务器

    概述 这篇文章是讲解如何使用socketserver建立一个异步TCP服务器,其中Python版本为3.5.1. socketserver主要的类 socketserver模块中的类主要有以下几个:1 ...

  5. jmeter-BeanShell PreProcessor的使用

    BeanShell简介 BeanShell是一个小型嵌入式Java源代码解释器,具有对象脚本语言特性,能够动态地执行标准JAVA语法.在BeanShell中,我们可以使用java语言自定义函数来处理特 ...

  6. SVN代码迁移到GITlab

    ==================================================================================================== ...

  7. react脚手架和深入理解jsx语法

    react的mvc和vue的mvvm vue的mvvm属于双向绑定,view层,model数据层,vm实现双向绑定的控制层 此种模式,再某一类项目种很有优势:管理系统 ( OA, ERP , CRM ...

  8. 归并非递归、快排递归及非递归的C++实现及时间效率对比。。

    今天看剑指offer突然发现下学期都要去面试了,还没自己实现过快排非递归和归并非递归,这怎么能行呢,于是就写了一下. (虽然有点卡壳,又回去翻了下算导,还是顺利写出来了) 先放图: 一亿数据量: #p ...

  9. Dart语言学习(四)Dart字符串

    一.字符串的创建 使用 单引号,双引号 创建字符串 使用 三个引号或双引号 创建多行字符串 使用 r 创建原始 raw 字符串 String str1 = 'Hello';//"" ...

  10. es6二进制数组--基础

    一.概念二进制数组由 ArrayBuffer对象 TypeArray 视图和DataView视图 三部分组成是javascript操作二进制数据的一个接口. 早在2011年2月就已经发布,但是由于ES ...