<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<tr>
<td></td>
<td class="btn">
<input type="button" value="提交" onclick="sub();"/>
</td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript">
function getvalue(){
var cardType = document.getElementById("cardType").value;
document.getElementById("openAmount").value="";
document.getElementById("tip_openAmount").innerHTML = "";
if(cardType == 1){
document.getElementById("a").style.display="inline";
document.getElementById("b").style.display="none";
}else{
document.getElementById("b").style.display="inline";
document.getElementById("a").style.display="none";
}
}
function sub(){
if(isEmptyById("cardNum")){
show("tip_cardNum");
return;
}else{
hide("tip_cardNum");
}
if(document.getElementById("custommerManager.id").value == ""){
show("tip_custommerManagerId");
return;
}else{
hide("tip_custommerManagerId");
}
var cardType = document.getElementById("cardType").value;
var a = document.getElementById("a").value;
var b = document.getElementById("b").value;
if(cardType==1){
document.getElementById("openAmount").value=a;
}
if(cardType==2){
document.getElementById("openAmount").value=b;
}
var openAmount = document.getElementById("openAmount").value;
//alert(openAmount);
if(openAmount==""){
document.getElementById("tip_openAmount").innerHTML ="";
document.getElementById("tip_openAmount").innerHTML ="请输入金额";
document.getElementById("tip_openAmount").style.display="inline";
return;
}else{
document.getElementById("tip_openAmount").style.display="none";
}
if(cardType==1){
if(openAmount==1000||openAmount%1000==0 ||openAmount!=0){
document.getElementById("tip_openAmount").style.display="none";
}else{
document.getElementById("tip_openAmount").innerHTML ="";
document.getElementById("tip_openAmount").innerHTML ="红卡用户金额为1000或1000倍数";
document.getElementById("tip_openAmount").style.display="inline";
return;
}
}
if(confirm("尊敬的用户,您是否确认激活该卡?")){
document.forms[0].submit();
}
}
</script>
这是我的代码 如果
选择客户经理:哦 那肯定是验证了,只是没有把你信息打出来而已
你在页面加一个
看错误信息有哪些?
提交不上具体表现是怎样的,比如是:报js错?报异常?还是什么信息提示都没有?
还有:是否用了jquery的验证框架的?
你自己的代码验证了呗:
[code="java"]if(document.getElementById("custommerManager.id").value == ""){
show("tip_custommerManagerId");
return;
}else{
hide("tip_custommerManagerId");
}
[/code]
这段代码就是验证,你去了就能提交了