表单验证问题

时间:2016-08-22 04:45:58

标签: javascript jquery html forms validation

我已尝试将此表单放在jsfiddle中,以发现它无法正常运行。如果输入不正确,表单不会验证任何字段,并且它不会继续到表单的第二部分。

以下是它应该如何运作(滚动到底部):http://infinite-woodland-5276.herokuapp.com/forms-validation.html

这是小提琴:https://jsfiddle.net/j31qm806/3/

/* form starting stylings ------------------------------- */
.group            { 
  position:relative; 
  margin-bottom:45px; 
}
input               {
  font-size:18px;
  padding:10px 10px 10px 5px;
  display:block;
  width:300px;
  border:none;
  border-bottom:1px solid #757575;
  background:transparent;
}
input:focus         { outline:none; }

/* LABEL ======================================= */
label                {
  color:#999; 
  font-size:18px;
  font-weight:normal;
  position:absolute;
  pointer-events:none;
  left:5px;
  top:10px;
  transition:0.2s ease all; 
  -moz-transition:0.2s ease all; 
  -webkit-transition:0.2s ease all;
}

/* active state */
input:focus ~ label, input:valid ~ label        {
  top:-20px;
  font-size:14px;
  color:#5264AE;
}

0 个答案:

没有答案