<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. shiro登录认证过程讲解

      先粘出登录的代码 1. 可以看到已经获取到了username和password ,为了接下来的认证过程,我们需要获取subject对象,也就是代表当前登录用户,并且要将username和passw ...

  2. bistoury的源码启动(二)

    bistoury.conf这个东东就是我们代码中的 -Dbistoury.conf=D:\openSource\bistoury\bistoury-proxy\conf 这样就能搞定了,一下子就能启动 ...

  3. 题解 P2320 【[HNOI2006]鬼谷子的钱袋】

    P2320 [HNOI2006]鬼谷子的钱袋 挺有趣的一道题,之所以发这篇题解是因为感觉思路的更清晰一点qwq 此题主要有两种方法: 一.分治思想 例如要凑出1~20,假如我们已经能凑出1~10了,那 ...

  4. thinkphp的where 之 or的使用

    需要生成 SELECT * FROM `goods` WHERE ( `goodstype_id` = 2 or `goodstype_id` = 3 ) $where['goodstype_id'] ...

  5. tensflow

    今天换了电脑,重新安装视频中软件,发现没记录很麻烦,还是记录以下步骤吧 打开终端输入指令:python,如图1所示,我的系统是ubuntu16.04.03,默认安装的python版本为2.7.12. ...

  6. 1.4 Eclipse 自动补全功能

    1.访问Content Assit 菜单项  window--preferences --Java---Editor--Content Assit 2. auto activation delay : ...

  7. Codeforces Round #604 (Div. 2)D(构造)

    构造,枚举起点,如果一个序列成立,那么将它reverse依然成立,所以两个方向(从小到大或从大到小)没有区别,选定一个方向进行探测,直到探测不到以后回头,只要所给数据能成立,那么能探测进去就能探测出来 ...

  8. mysql 慢查询日志 (mysqldumpslow坑还没填)

    MySQL的慢查询日志是MySQL提供的一种日志记录,用来记录在MySQL中响应时间超过long_query_time值的SQL语句(秒为单位). 默认情况下MySql数据库没有开启慢查询日志, my ...

  9. jvm字节码助记符

    反编译指令 javap -c xxxx.class JVM参数设置 -xx:+<option>                  开启option -xx: -<option> ...

  10. P & R 9

    Floorplan: 要做好floorplan需要掌握哪些知识跟技能? 明确Floorplan 处理的对象:对于数字设计的 Floorplan 来说,它是一个很依赖前后步骤的一个过程,这个可以看作是后 ...