在jsp中输入日期为dd / mm / yyyy,它也不是必填字段

时间:2019-06-20 05:44:22

标签: jsp

我想输入日期为dd / mm / yyyy,但这不是必填字段,因此当我们提交时未填写应提交的日期字段

我尝试了以下操作,但对我不起作用,它无法验证格式

<div class="col50per">
  <div class="fieldLbl" >
    <label id="GenLabel">Date:</label>
  </div>
  <div class="inputField">

  <c:if test="${(employee.date ne null)}">
    <form:input 
          path="date" id="genDate"  
          style="width: 120px;"
          class="input-control"  
          data-validation="date"
          data-validation-format="dd/mm/yyyy"
          data-validation-help="Please enter date in dd/mm/yyyy format"
    />		
  </c:if>	

  <c:if test="${(employee.date eq null) or (employee.date eq '')}">
    <form:input 
          path="date" 
          id="genDate"  
          style="width: 120px;"
          class="input-control"
    />		
  </c:if>

  </div>
</div>

0 个答案:

没有答案