Closed GoogleCodeExporter closed 8 years ago
你在return之间,编写你自己的代码不就行了。
并且你可以修改finalResult的值,改为false表单就不会提交了。
Original comment by bad...@gmail.com
on 15 Dec 2009 at 9:08
badqiu, 你好, 回复的好快,谢谢
目前是这样:
new Validation(document.forms[0],{onSubmit:true,onFormValidate : function
(result,form) {
var finalResult = result;
alert(result);
// return disableSubmit(finalResult,'submitButton');
return addOrgIdUserName();
}});
function addOrgIdUserName(){
document.forms[0].j_username.value = document.forms
[0].orgId.value+"~###~"+document.forms[0].j_username.value;
document.forms[0].submit();
}
Original comment by wfu...@gmail.com
on 15 Dec 2009 at 9:25
最终参考了
badqiu的代码,很好。很强大! 谢谢
<script>
new Validation(document.forms[0],{onSubmit:true,onFormValidate : function
(result,form) {
var finalResult = result;
return addOrgIdUserName(finalResult,'submitButton');
}});
//提交前,把机构号和用户名整合,可做类似参考做为校验后的自定义功能
function addOrgIdUserName(finalResult,submitButtonId) {
if(finalResult) {
document.forms[0].j_username.value = document.forms
[0].orgId.value+"~###~"+document.forms[0].j_username.value;
document.getElementById(submitButtonId).disabled = true;
return finalResult;
}else {
return finalResult;
}
}
</script>
Original comment by wfu...@gmail.com
on 15 Dec 2009 at 9:46
Fixed
Original comment by bad...@gmail.com
on 18 Dec 2009 at 6:31
Original issue reported on code.google.com by
wfu...@gmail.com
on 15 Dec 2009 at 9:04